我正在做一个小的课外元素来增强我的 html5/css3/jquery 知识,我正在使用视差滚动,但我似乎无法让底部图像滚动到 View 中。它似乎卡在上面的后面,无论我做什么,我似乎都无法将它拉下来。
底部黑色部分应该有一张巨大的美元钞票,上面写着“Abe is the money”
我的网址是:http://www.petegetscreative.com/abe/index.html
灵感来自本教程:http://net.tutsplus.com/tutorials/html-css-techniques/simple-parallax-scrolling-technique/
干杯
最佳答案
我认为美元钞票图像太小了。
查看this Fiddle ,当我将美元钞票图像的大小增加到 200% 时,它在预览中变得可见。
#known {
background: url(http://www.petegetscreative.com/abe/images/US-$5-SC-1953-Fr.1655.2.jpg) 50% 0 no-repeat fixed;
background-color: #000;
background-size: 200%;
height: 600px;
margin: 0 auto;
width: 100%;
max-width: 1920px;
position: relative;
padding-top: 50px;
}
所以可能发生的情况是图像的高度小于滚动位置的差异。尝试更大(更高)的图像。
关于javascript - 视差滚动图像超出视野,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19774761/