<分区>
<分区>
我有几张图片,我想将它们作为信息图表垂直放置在页面上。但是,我想将背景与前景元素分开,并有一点视差效果,当您向下滚动时,前景(背景)元素移动 ...
不确定如何最好地使用 jQuery 或什至 CSS3 完成此操作...任何链接或示例将不胜感激。
最佳答案
您可以使用 jquery.parallax .
jParallax turns nodes into absolutely positioned layers that move in response to the mouse. Depending on their dimensions these layers move at different rates, in a parallaxy kind of way.
屏幕截图:
(来源:stephband.info)
代码也很小。
<ul>
<li class="parallax-layer"></li>
<li class="parallax-layer"></li>
</ul>
关于jquery - 视差效果 : Make foreground move when scrolling,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12851501/