Posted in Javascript onApril 24, 2014
var currentPosition,timer; function GoBottom(){ timer=setInterval("runToBottom()",50); } function runToBottom(){ currentPosition=document.documentElement.scrollTop || document.body.scrollTop; currentPosition+=30; if(currentPosition<document.body.scrollHeight && (document.body.clientHeight + document.body.scrollTop < document.body.scrollHeight)) { //window.scrollTo(0,currentPosition); //alert(document.documentElement.clientHeight + " " + document.documentElement.scrollTop + " " + document.documentElement.scrollHeight + "#" +document.body.clientHeight + " " + document.body.scrollTop + " " + document.body.scrollHeight); document.body.scrollTop = currentPosition; } else { document.body.scrollTop = document.body.scrollHeight; clearInterval(timer); } }
js动态移动滚动条至底部示例代码
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@