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

    申明

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

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

  • 相关阅读:
    自我学习而已——javascript——变量,作用域和内存问题
    自我学习而已——javascript——数据类型部分
    面向对象三大特性之封装
    面向对象三大特性之继承与多态
    初识面向对象
    python常用模块(re模块)
    递归函数与算法
    Python之匿名函数
    python之内置函数
    各种推导式
  • 原文地址:https://www.cnblogs.com/Athrun/p/1262194.html
Copyright © 2011-2022 走看看