• Js获取标签高度


     能力有限:问个问题,标签相对页面高度,是怎么写?

    1. 鼠标的横坐标,X轴:  event.clientX;
    2. 鼠标的竖坐标,Y轴:  event.clientY;
    3. 网页可见区域宽:      document.body.clientWidth;
    4. 网页可见区域高:          document.body.clientHeight;
    5. 网页可见区域高(包括边线的宽): document.body.offsetHeight;
    6. 网页正文全文宽:      document.body.scrollWidth;
    7. 网页正文全文高:      document.body.scrollHeight;
    8. 网页被卷去的左:    document.body.scrollLeft;  
    9. 网页正文部分上:      window.screenTop;
    10. 网页正文部分左:      window.screenLeft;
    11. 屏幕分辨率的高:      window.screen.height;
    12. 屏幕分辨率的宽:    window.screen.width;
    13. 屏幕可用工作区高度:    window.screen.availHeight;
    14. 屏幕可用工作区宽度:    window.screen.availWidth;
    15. 标签内部高度:        divHg.clientHeight;     divHg为对象: var divHg = document.getElementById("xxxxx");
    16. 标签内部高度:        divWd.clientWidth;     divWd为对象: var divWd = document.getElementById("xxxxx");

    =================================Script使用例子===================================

    var divHg = document.getElementById("tit");//标签id
    var divWd = document.getElementById("tit");//标签id
    var s ="鼠标的横坐标,X轴:"+ event.clientX;
    s += " 鼠标的竖坐标,y轴:"+ event.clientY;
    s += " 网页可见区域宽 :"+ document.body.clientWidth;
    s += " 网页可见区域高:"+ document.body.clientHeight;
    s += " 网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽)";
    s += " 网页正文全文宽:"+ document.body.scrollWidth;
    s += " 网页正文全文高:"+ document.body.scrollHeight;
    s += " 网页被卷去的高:"+ document.body.scrollTop;
    s += " 网页被卷去的左:"+ document.body.scrollLeft;
    s += " 网页正文部分上:"+ window.screenTop;
    s += " 网页正文部分左:"+ window.screenLeft;
    s += " 屏幕分辨率的高:"+ window.screen.height;
    s += " 屏幕分辨率的宽:"+ window.screen.width;
    s += " 屏幕可用工作区高度:"+ window.screen.availHeight;
    s += " 屏幕可用工作区宽度:"+ window.screen.availWidth;
    s += " 标签内部高度:"+ divHg.clientHeight;
    s += " 标签内部宽度:"+ divWd.clientWidth;
    alert(s);

  • 相关阅读:
    序列号Pickle模块
    随机数Random模块
    selenium保存cookies 实例02
    selenium读取浏览器已有Cookies 实例01
    selenium的简单演示程序
    java连接sftp服务器读取压缩包的文件(例:读取zip中的csv文件返回数组)
    java实现连接sftp服务器并下载文件到本地
    在idea中实现热部署
    java使用IText将数据导出为pdf文件(数据为excel表格样式)
    使用poi解析Excel文件转化数组形式的集合(List<String[] list)
  • 原文地址:https://www.cnblogs.com/lbjz/p/3495110.html
Copyright © 2020-2023  润新知