zoukankan      html  css  js  c++  java
  • (document).height()、$(document).scrollTop()

    转载自:http://www.th7.cn/web/js/201503/90676.shtml

    jQuery(window).height()                 //代表了当前课件区域的大小;

    jQuery(document).height()          //则代表了整个文档的高度,可视具体情况使用

    *****注意当浏览器窗口大小改变时(如最大化或拉大窗口后) jQuery(window).height() 随之改变 , 但是jQuery(document).height()是不变的。

    $(document).scrollTop()              //获取垂直滚动的距离 即当前滚动的地方的窗口顶端到整个页面顶端的距离

    $(document).scrollLeft()                //这是获取水平滚动条的距离

    要获取顶端 只需要获取到scrollTop()==0的时候 就是顶端了

    要获取底端 只要获取scrollTop()>=(document).height()−(window).height() 就可以知道已经滚动到底端了

    height:指元素内容的高度 ,jQuery中的height()方法返回的就是这个高度。 
    clientHeight:内容高度+padding高度 ,jQuery中的innerHeight()方法返回的就是这个高度。 
    offsetHeight:内容高度+padding高度+边框宽度 ,jQuery中的outerHeight()方法返回的就是这个高度。

  • 相关阅读:
    示波器测量电源的纹波
    hdoj 2717 Catch That Cow
    hdoj 1548 A strange lift
    hdoj 4586 Play the Dice
    zoj 2095 Divisor Summation
    hdoj 4704 Sum
    router-link传参
    字体自适应
    横向滚动div
    vue路由
  • 原文地址:https://www.cnblogs.com/fifis/p/4740326.html
Copyright © 2011-2022 走看看