日期:2014-05-16  浏览次数:20399 次

请问这个网页顶部的图片滚动效果是怎么实现的?谢谢
就是这个网页:http://www.nilock.com/2011/05/19/a-parallax-scrolling-demo/comment-page-1/

谢谢大家啦
就是顶部的云是怎么滚动的?

------解决方案--------------------
$( function($) {
var current = 0;
setInterval(function(){
if(current==-6000) {current=0;}
current -=600;
$('#header-background').animate({backgroundPosition:current+"px 0px"},25000);
},2500);
}) 

这个是实现的代码,原理就是不断的改背景图片的位置