zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    数据库子查询
    数据库简介
    MySql数据类型
    Jquery与js简单对比
    JS-对象
    JS-DOM
    JS-数组
    JS-函数
    JS-json
    JS-类型相关
  • 原文地址:https://www.cnblogs.com/windstore/p/1588897.html
Copyright © 2011-2022 走看看