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
}
}
精彩评论