点击直接跳回头部
//页面加载完毕触发
window.onload = function(){
var time = null;
var obtn = document.getElementById('btn');
obtn.onclick = function(){
//设置定时器
time = setInterval(function(){
//获取滚动条与顶部的距离
var osTop = document.documentElement.scrollTop || document.body.scrollTop;
document.documentElement.scrollTop = document.body.scrollTop -=200;
},30);
}
}