复制代码 代码如下:
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);
}
}
标签:
动态移动,滚动条,底部

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
评论“js动态移动滚动条至底部示例代码”
暂无“js动态移动滚动条至底部示例代码”评论...