web前端|js教程
滚动条,顶部
web前端-js教程
先把下面的代码拷贝到个html中,运行看效果
免费手游联运平台源码,vscode 一键折叠,ubuntu 连接投影,web实验用tomcat,爬虫在哪接单,php 磁力链,关键词seo推广方案,卡盟平台的网站源码,layui 商品列表 模板lzw
var currentPosition,timer;
function GoTop(){
timer=setInterval("runToTop()",1);
}
function runToTop(){
currentPosition=document.documentElement.scrollTop || document.body.scrollTop;
currentPosition-=10;
if(currentPosition>0)
{
window.scrollTo(0,currentPosition);
}
else
{
window.scrollTo(0,0);
clearInterval(timer);
}
}
饭
吃
家
回
你
带
返回顶部
window.scrollTo(0,document.body.scrollHeight);
速度可以自己控制哦。
响应式高端网站模板平台源码下载,Ubuntu熄屏花屏,崂山海边爬虫,php _exec,展会seo优化lzw