首页 > Web开发 > 详细

html

时间:2017-08-11 16:29:57      阅读:147      评论:0      收藏:0      [点我收藏+]

scroll详解:

  window.innerHeight  document.documentElement.clientHeight   // 可视区域的高度

  document.body.clientHeight  // body高度

  scroll的属性 scrollTop scrollHeight (scroll是一个点)

  scrollHeight = document.body.clientHeight -  document.documentElement.clientHeight  (只有容器装不下才会有滚动条,scrollHeight指滚动条可滑动的距离)

    (例如scrollHeight = 400 ,scrollTop到400就到底了)

html

原文:http://www.cnblogs.com/insight0912/p/7346526.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!