避免在视差滚动效果中对图像进行不必要的缩放



这是我的演示,因为你可以看到图像的比例,所以视差包装器的顶部不能是动态的。

演示: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

小提琴

最新更新