我在我的一个页面上使用纯css滑动标题。目的是让整个标题在图像悬停时从右向左滑出。
然而,它似乎并没有起作用。我的代码基于http://www.hongkiat.com/blog/css3-image-captions/,因此全宽图像将有一个标题。这是" programmesimages"和" programmesimagescaption"类。
* {
margin: 0px;
padding: 0px;
}
body{
background: url(../images/subtle_white_mini_waves.png) repeat;
}
#wrapper{
width:1180px;
margin: 0 auto;
overflow: hidden;
position: relative;
}
#programmescontent{
position:relative;
width:100%;
height:1000px;
background:#333;
z-index:-50;
margin-top:-73px;
}
.programmesimages{
position:relative;
width:100%;
height:600px;
background:#fff;
overflow:hidden;
}
.programmesimages img{
position: absolute;
left: 0;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
.programmesimagescaption{
background-color:#CF0;
position: absolute;
color: #fff;
z-index: 100;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
width:1180px;
height:600px;
left:1180px;
}
.programmesimages:hover .programmesimagescaption{
-moz-transform: translateX(-100%);
-o-transform: translateX(-100%);
-webkit-transform: translateX(-100%);
opacity: 1;
transform: translateX(-100%);
}
.programmesimages:hover img{
-moz-transform: translateX(-100%);
-o-transform: translateX(-100%);
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
}

<div id="programmescontent">
<div class="programmesimages">
<img src="http://www.thevisibilityproject.com/wp-content/uploads/2014/10/TheEndAgain_288-1180x600.jpg">
<div class="programmesimagescaption">
<h3>Caption</h3>
</div>
</div>
<div id="programmescarousel">
</div>
</div>
&#13;