当“图像条”悬停时,它会打开到其内容的高度。但是,这样做时也应该有一个平滑的过渡。我究竟做错了什么?CSS3 似乎没有影响它。
Javascript:
<script type="text/javascript">
function hover(id) {
document.getElementById(id).style.height="100%";
}
</script>
风格:
#image-strip{
width: 100%;
height: 300px;
float: left;
overflow: hidden;
transition: all 0.3s ease-in;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
cursor: pointer;
}
#image-strip img{
width: 100%;
}
的HTML:
<div id="image-strip" onmouseover="hover('image-strip')"><img src="images/content/1.jpg"></div>