zoukankan      html  css  js  c++  java
  • JS返回網頁的高和寬

       var strInfo=""
       strInfo
    +="\r\n網頁可見區域寬:"+document.body.clientWidth; 
       strInfo
    +="\r\n網頁可見區域高:"+document.body.clientHeight; 
       strInfo
    +="\r\n網頁可見區域寬:"+document.body.offsetWidth+"(包括邊線的寬)"
       strInfo
    +="\r\n網頁可見區域高:"+document.body.offsetHeight+"(包括邊線的寬)"
       strInfo
    +="\r\n網頁正文全文寬:"+document.body.scrollWidth; 
       strInfo
    +="\r\n網頁正文全文高:"+document.body.scrollHeight; 
       strInfo
    +="\r\n網頁被捲去的高:"+document.body.scrollTop; 
       strInfo
    +="\r\n網頁被捲去的左:"+document.body.scrollLeft; 
       strInfo
    +="\r\n網頁正文部分上:"+window.screenTop; 
       strInfo
    +="\r\n網頁正文部分左:"+window.screenLeft; 
       strInfo
    +="\r\n屏幕分辨率的高:"+window.screen.height; 
       strInfo
    +="\r\n屏幕分辨率的寬:"+window.screen.width; 
       strInfo
    +="\r\n屏幕可用工作區高度:"+window.screen.availHeight; 
       strInfo
    +="\r\n屏幕可用工作區寬度:"+window.screen.availWidth; 
       window.confirm(strInfo);

    申明

    非源创博文中的内容均收集自网上,若有侵权之处,请及时联络,我会在第一时间内删除.再次说声抱歉!!!

    博文欢迎转载,但请给出原文连接。

  • 相关阅读:
    SQL表结构
    Mssql 行转列
    动态Order by
    Nopi Excel导入
    使用SyncToy 同步两台机器上的文件夹
    ueditor1.4.3 在IE8下的 BUG
    WebService国内省市县接口
    AsyncTask的参数介绍
    Json分割并解析
    JQuery iframe页面操作父页面中的元素与方法
  • 原文地址:https://www.cnblogs.com/Athrun/p/1262194.html
Copyright © 2011-2022 走看看