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

    申明

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

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

  • 相关阅读:
    Ubuntu使用之Svn命令小技巧
    Android
    Python&MySQL&PyQt
    YII进行数据增删改查分析
    UVA270-Lining Up
    block高级功能
    HDU-2665-Kth number(划分树)
    Android模糊演示样例-RenderScript-附效果图与代码
    HTTP状态码具体解释
    近期写的一个控件——Well Swipe beta 1.0
  • 原文地址:https://www.cnblogs.com/Athrun/p/1262194.html
Copyright © 2011-2022 走看看