windstore

javascript获取滚动条位置

<script type="text/javascript">
function getScroll()  {    
var t, l, w, h;        
if (document.documentElement && document.documentElement.scrollTop) {          
   t = document.documentElement.scrollTop;
  l = document.documentElement.scrollLeft;      
  w = document.documentElement.scrollWidth;        
  h = document.documentElement.scrollHeight;    
} else if (document.body) {        
  t = document.body.scrollTop;      
  l = document.body.scrollLeft;        
  w = document.body.scrollWidth;        
  h = document.body.scrollHeight;    
}
    
return { t: t, l: l, w: w, h: h };
}
</script>

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-08-21
  • 2021-11-17
猜你喜欢
  • 2021-11-17
  • 2021-09-16
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
相关资源
相似解决方案