zoukankan      html  css  js  c++  java
  • 检测浏览器宽和高

    检测浏览器宽和高


    function GetInfo(){
    var s = "";
        s += "\r\n网页可见区域宽clientWidth:"+ document.body.clientWidth;
        s += "\r\n网页可见区域高clientHeight:"+ document.body.clientHeight;
        s += "\r\n网页可见区域宽offsetWidth:"+ document.body.offsetWidth + " (包括边线和滚动条的宽)";
        s += "\r\n网页可见区域高offsetHeight:"+ document.body.offsetHeight + " (包括边线的宽)";
        s += "\r\n网页正文全文宽scrollWidth:"+ document.body.scrollWidth;
        s += "\r\n网页正文全文高scrollHeight:"+ document.body.scrollHeight;
        s += "\r\n网页被卷去的高(ff)scrollTop:"+ document.body.scrollTop;
        s += "\r\n网页被卷去的高(ie)scrollTop:"+ document.documentElement.scrollTop;
        s += "\r\n网页被卷去的左scrollLeft:"+ document.body.scrollLeft;
        s += "\r\n网页正文部分上screenTop:"+ window.screenTop;
        s += "\r\n网页正文部分左screenLeft:"+ window.screenLeft;
        s += "\r\n屏幕分辨率的高screen.height:"+ window.screen.height;
        s += "\r\n屏幕分辨率的宽screen.width:"+ window.screen.width;
        s += "\r\n屏幕可用工作区高度.screen.availHeight:"+ window.screen.availHeight;
        s += "\r\n屏幕可用工作区宽度screen.availWidth:"+ window.screen.availWidth;
        s += "\r\n你的屏幕设置是screen.colorDepth:"+ window.screen.colorDepth +" 位彩色";
        alert (s);
    }
    


  • 相关阅读:
    虚方法和抽象方法
    c#_实现FTP方法(一) FtpWebRequest
    sql server 分页
    5ucms进阶
    图片处理函数
    [转]C++11新特性:Lambda函数
    [STL]for_each详细用法[转]
    [算法]hash table 与 hash map 实现
    [算法]字典树
    [STL]vector的使用[转]
  • 原文地址:https://www.cnblogs.com/dean5277/p/2646264.html
Copyright © 2011-2022 走看看