zoukankan      html  css  js  c++  java
  • Jquery 文档的各种高度和宽度

    $(document).ready(function()   {  
    alert($(window).height()); //浏览器时下窗口可视区域高度  
    alert($(document).height()); //浏览器时下窗口文档的高度  
    alert($(document.body).height());//浏览器时下窗口文档body的高度  
    alert($(document.body).outerHeight(true));//浏览器时下窗口文档body的总高度包括border padding margin  
    alert($(window).width()); //浏览器时下窗口可视区域宽度  
    alert($(document).width());//浏览器时下窗口文档对于象宽度  
    alert($(document.body).width());//浏览器时下窗口文档body的高度  
    alert($(document.body).outerWidth(true));//浏览器时下窗口文档body的总宽度包括border padding margin  
    } ) 
     JQuery的$(window).height()指示的是浏览器窗口的高度;
    
    $(document).height();如果文档的内容的高度还不足浏览器的高度的时候,则浏览器窗口的高度<br>     但是当文档点内容高度超过浏览器的高度点时候,则其高度是整个文档的高度。
    $(document.body).height() 则指的是文档的实际高度。

    不想设置fixed,即使body高度很小也能把底部内容放到底部的方法:

    var h=$(document).height();
    $('body').css('height',h);

    样式:position:absolute;bottom:10px;

     转自:http://www.cnblogs.com/java-boy/archive/2012/07/15/2592386.html

  • 相关阅读:
    初次使用github
    linux 如何显示一个文件的某几行
    ubuntu 2
    在html页中作跳转
    gmail邮箱 livemail 设置
    配置nginx与wordpress碰到的一个偱环重定向问题
    在nginx服务部署startbbs
    Attaching the script debugger to process *** failed on machine "***"
    linux查看文件夹大小
    linux 合并文件
  • 原文地址:https://www.cnblogs.com/lvchenfeng/p/4922704.html
Copyright © 2011-2022 走看看