我正在做一个网站项目,我想要这个很酷的悬停效果,但我似乎无法让它正常工作?
我有一个黑胶唱片盒图像,该图像向左滑动,带有标题(溢出:隐藏)以显示其后面的唱片图像。同时从左边我想要一个记录的描述从向左移动的vinly记录盒后面滑出,并在记录图像的顶部,有点不透明,所以你仍然可以看到记录(这部分简单)
这是html代码:
<div id="stations">
<div class="grid_3">
<div class="records"><!-- sleeve -->
<h3>Groove Salad</h3>
<div class="recordsinfo">Station description.</div>
</div>
</div>
</div>
这是CSS代码:
#stations>div {
background-image: url(http://benlevywebdesign.com/somafm/images/SomaFMrecord.png);
background-repeat:no-repeat;
height: 220px;
margin-bottom: 20px;
position: relative;
overflow:hidden;
}
#stations>div>.records{
background-image: url(http://benlevywebdesign.com/somafm/images/SomaFM.png);
background-repeat:no-repeat;
height: 220px;
margin-bottom: 20px;
overflow:hidden;
position:relative;
}
#stations>div>.records>h3 {
color: #FFF;
background-color: rgba(255,255,255, 0.45);
width:200px;
margin-top:0px;
margin-bottom:-5px;
padding: 10px 10px 3px;
}
#stations>div>.records>.recordsinfo{
position: absolute;
left:-150px;
bottom: 0;
margin: 5px 10px;
}
@-moz-keyframes slideout {
0% { left:0; }
100% { left:-100px; }
}
@-webkit-keyframes slideout {
0% { left:0; }
100% { left:-100px; }
}
@keyframes slideout {
0% { left:0; }
100% { left:-100px; }
}
#stations>div>.records:hover{
height: 220px;
width:220%;
margin-bottom: 20px;
left:-100px;
overflow:hidden;
position: relative;
-moz-animation: slideout 0.75s 1;
-webkit-animation: slideout 0.75s 1;
animation: slideout 0.75s 1;
}
#stations>div>.records>.recordsinfo:hover{
height: 220px;
width:220%;
left:150px;
overflow:hidden;
position: relative;
-moz-animation: slidein 0.75s 1;
-webkit-animation: slidein 0.75s 1;
animation: slidein 0.75s 1;
}
这是它的一个小提琴,直到最后一部分是描述不起作用并滑出左边!