javascript 此页面上的不同元素似乎以不同的速度滚动。这是怎么做的?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8384576/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Different elements on this page appear to scroll at different speeds. How was this done?
提问by user852974
The effect i am refering to is visible at http://whyinteractive.com/showreel. The elements appear to scroll behind and in front of one another at different speeds creating some cool effects. How was this done?
我所指的效果在http://whyinteractive.com/showreel上可见。这些元素似乎以不同的速度在彼此的前后滚动,从而产生了一些很酷的效果。这是怎么做的?
回答by Alec Smart
What you are looking for is called the Parallax effect.
您正在寻找的称为视差效果。
You can learn more at sites like:
您可以在以下网站了解更多信息:
http://stephenmcintyre.net/blog/jquery-parallax-scrolling/
http://stephenmcintyre.net/blog/jquery-parallax-scrolling/
UPDATE:
更新:
This is pretty much exactly what you need:
这几乎正是您所需要的:
CODE: Build a parallax scrolling website interface with jQuery & CSS
DEMO: Parallax Scrolling
演示:视差滚动