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);
    }
    


  • 相关阅读:
    PHP抛出简单说明
    html设置强制缓存的方法
    php yield处理大数据的方法
    pixijs 粒子聚合图片
    PHP监听消息队列的方法
    C++ fstream 二进制读写文件 (一个文件备份的例子)
    Ubuntu18.04下Docker CE安装
    Python3.9安装
    如何通过SQL命令更改Postgres的max_connections
    ubuntu 配置br0网桥,亲测有效
  • 原文地址:https://www.cnblogs.com/dean5277/p/2646264.html
Copyright © 2011-2022 走看看