已采纳回答 / 心灵驿站2
我给你测了一下,除了回到顶部放上去没有回到顶部的这样外,其他代码都没问题。想要测试的话,你还是把课程的素材下下来,自己试一下。注意上面的那个<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">一定要有,不然不行。
2017-02-11
最赞回答 / 玉鸯子
osTop 只是一个变量.里面存有 当前滚动条距离页面顶部距离的值.而你写"osTop=200",只是操作变量osTop,将它的值重置成了200.与document.documentElement.scrollTop这个属性没有关系.
2016-11-30
最新回答 / illa
<script type="text/javascript">window.onload=function(){ var obtn=document.getElementById("btn"); //获取页面的可视区域的高度 var clientHeight=document.documentElement.clientHeight||document.body.clientHeight; var timer=null; var isTop=true; obtn.onclick=functio...
2016-11-14