开发者

Timed scrolling in javascript

I need a script开发者_如何学Go that scrolls automatically throught my page without buttons,I want it to scroll down every 10 seconds and then return to the top when done,how would i do this in javascript?

Thanks, Lee


You want to use a combination of the jquery scrollTo() plugin and the javascript setTimeout() function. You would do something like (pseudocode):

setTimeout(scrollMyPage, 10000)
{
    if (At bottom of the page)
    {
        scroll To Top
    }
    else
    {
        scroll down the height of the browser window/a page
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜