这是我的演示,因为你可以看到图像的比例,所以视差包装器的顶部不能是动态的。
演示:http://jsfiddle.net/KsdeX/12/
.wrapper-parallax {
margin-top: 150px;
margin-bottom: 60px;
}
对此有什么可能的解决方案?img的最大宽度?
是的,我真的不明白这里的问题是什么,你可以只做
img {
position: fixed;
top: 0;
max-width: 350px;
z-index: -1;
background: cyan;
}
然后图像就不再缩放了?
我相信这就是你想要的。。
I had to use some javascript in this code, and declared some ids to make it easy for me :p
小提琴