首页 > 解决方案 > 创建 JS chrome 片段以在无限循环中自动上下滚动页面

问题描述

我需要在屏幕上显示 Jira 仪表板的内容,并在无限循环中自动上下滚动。我试图创建 Chrome 代码段,但 for/while 循环似乎不起作用。

function scroll(speed) {
    $('html, #ghx-pool').animate({ scrollTop: $(document).height() - $(window).height() }, speed, function() {
        $(this).animate({ scrollTop: $(document).height() }, speed);
    });
}
while(true){
    setInterval(scroll(25000), 10);  
}

标签: javascriptjqueryhtmlgoogle-chrome

解决方案


推荐阅读