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

  • 相关阅读:
    极光推送的的栗子
    老师oracle讲义第五天
    oracle学习第五天
    ajax使用
    jstl标签的使用
    json使用
    jsp的el表达式使用
    老师oracle讲义第三天
    oracle学习第一天
    oracle学习第二天
  • 原文地址:https://www.cnblogs.com/lvchenfeng/p/4922704.html
Copyright © 2011-2022 走看看