0

此处显示的脚本在链接处有效,但在我放入网站时无效,有什么问题?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);
});//]]>  
4

1 回答 1

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);
});//]]> 
于 2013-09-06T05:52:07.913 回答