【发布时间】:2016-12-27 15:11:52
【问题描述】:
使用下面的放大效果从这里https://codepen.io/dragoeco/pen/ibrzK
需要一些帮助来让背景图像淡入并在悬停时产生缩放效果,就像这里的 http://fantasy.co/work 保持前景徽标相同。
.image-box{
width:300px;
overflow:hidden;
}
.image {
width:300px;
height:200px;
background: url("http://lorempixel.com/300/200");
background-position:center;
transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-webkit-transition: all 1s ease;
-o-transition: all 1s ease;
}
.image:hover {
transform: scale(1.5);
-moz-transform: scale(1.5);
-webkit-transform: scale(1.5);
-o-transform: scale(1.5);
-ms-transform: scale(1.5); /* IE 9 */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1.5, M12=0, M21=0, M22=1.5, SizingMethod='auto expand')"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Matrix(M11=1.5, M12=0, M21=0, M22=1.5, SizingMethod='auto expand'); /* IE6 and 7 */
}
<div class="image-box">
<div class="image">
</div>
</div>
【问题讨论】:
标签: jquery html css image css-transitions