zoukankan      html  css  js  c++  java
  • JQ取浏览器窗口大小

    今天正好用到这个,就网上搜了搜,贴出来了。如果对你有帮助,不胜荣幸。

    function getTotalHeight(){
     if($.browser.msie){
      return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight : document.body.clientHeight;
     }
     else {
      return self.innerHeight;
     }
    }

    function getTotalWidth (){
     if($.browser.msie){
      return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth : document.body.clientWidth;
     }
     else{
      return self.innerWidth;
     }
    }

    var do_height = getTotalHeight();
    var do_width = getTotalWidth();
    alert("do_height=="+do_height+"\ndo_width=="+do_width);

    前端小菜。。。
    努力成为大菜!
  • 相关阅读:
    Car HDU
    Defeat the Enemy UVALive
    Alice and Bob HDU
    Gone Fishing POJ
    Radar Installation POJ
    Supermarket POJ
    Moo Volume POJ
    Text Document Analysis CodeForces
    checkbox全选与反选

  • 原文地址:https://www.cnblogs.com/chengj/p/1997941.html
Copyright © 2011-2022 走看看