此处显示的脚本适用于链接,但当我放入网站时无法正常工作,出现了什么问题?http://jsfiddle.net/QUCWe/
//<![CDATA[
$(window).load(function(){
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed);
});
}
speed = 1000;
scroll(speed)
setInterval(function(){scroll(speed)}, speed * 2);
});//]]>
答案 0 :(得分:0)
我改变速度* 2并且有效;
//<![CDATA[
$(window).load(function(){
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed);
});
}
speed = 1000;
scroll(speed)
setInterval(function(){
scroll(speed)
}, 3000);
});//]]>