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

  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 += "\r\n鼠标的竖坐标,y轴:"+ event.clientY;
s += "\r\n网页可见区域宽 :"+ document.body.clientWidth;
s += "\r\n网页可见区域高:"+ document.body.clientHeight;
s += "\r\n网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽)";
s += "\r\n网页正文全文宽:"+ document.body.scrollWidth;
s += "\r\n网页正文全文高:"+ document.body.scrollHeight;
s += "\r\n网页被卷去的高:"+ document.body.scrollTop;
s += "\r\n网页被卷去的左:"+ document.body.scrollLeft;
s += "\r\n网页正文部分上:"+ window.screenTop;
s += "\r\n网页正文部分左:"+ window.screenLeft;
s += "\r\n屏幕分辨率的高:"+ window.screen.height;
s += "\r\n屏幕分辨率的宽:"+ window.screen.width;
s += "\r\n屏幕可用工作区高度:"+ window.screen.availHeight;
s += "\r\n屏幕可用工作区宽度:"+ window.screen.availWidth;
s += "\r\n标签内部高度:"+ divHg.clientHeight;
s += "\r\n标签内部宽度:"+ divWd.clientWidth;
alert(s);

Js获取标签高度的更多相关文章

  1. JS获取div高度的方法

    有时在写页面时,需要获取一个div的高度.怎么才能获取呢?哈哈,先上结论.有两种方法. offsetHeight .clientHeight getComputedStyle offsetHeight ...

  2. js获取浏览器高度和宽度值,尽量的考虑了多浏览器。

    js获取浏览器高度和宽度值,尽量的考虑了多浏览器. IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ...

  3. jquery、js获取页面高度宽度等

    jquery获取页面高度宽度 //获取浏览器显示区域(可视区域)的高度 : $(window).height(); //获取浏览器显示区域(可视区域)的宽度 : $(window).width(); ...

  4. 【转】js 获取浏览器高度和宽度值(多浏览器

    原文地址:http://www.jb51.net/article/19844.htm js获取浏览器高度和宽度值,尽量的考虑了多浏览器. IE中: document.body.clientWidth ...

  5. JS获取标签内容的方法

    JS获取标签内容的方法 测试代码 <!DOCTYPE html> <html lang="en"> <head> <meta charse ...

  6. js获取浏览器高度

    常用: JS 获取浏览器窗口大小 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 获取窗口宽度 if (window.innerWidth) winWidth = ...

  7. JS获取浏览器高度 并赋值给类

    在给网站做轮播焦点图的时候,如果需要全屏的话,可以用下面的jQuery来获取浏览器高度,然后赋值给类. $(window).load(function () { var maxHeight = 0; ...

  8. js 获取浏览器高度和宽度值(多浏览器)(转)

    IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...

  9. 转:JS获取浏览器高度和宽度

    发现一篇好文章,汇总到自己的网站上. IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> ...

随机推荐

  1. oracle where 后面的条件中|| 是什么意思

    oracle where 后面的条件中|| 是连接符号,Oracle中另一个concat函数能够连接两个字符串 concat(a,b) Oracle中nvl函数的使用方法和作用是什么? 假设你某个字段 ...

  2. 自增锁预分配ID

    http://www.cnblogs.com/xpchild/p/3825309.html mysql> show create table pp; CREATE TABLE `pp` ( `i ...

  3. IDEA加密(转)

    1. 简介 IDEA是International Data Encryption Algorithm 的缩写,是1990年由瑞士联邦技术学院来学嘉X.J.Lai 和Massey提出的建议标准算法称作P ...

  4. 浅谈 qmake 之 pro、pri、prf、prl文件

    尽管每次和cmake对比起来,我们总是说 qmake 简单.功能少.但是qmake仍然是一个非常复杂的东西,我想大多人应该和我一样吧: 不是太清楚CONFIG等变量到底如何起作用的 用过的qmake内 ...

  5. archlinux locale-gen 命令出错

    如果运行locale-gen命令出现以下的错误“locale alias file `/usr/share/locale/locale.alias' not found: No such file o ...

  6. SQL Server数据库自增字段正确的插入值的描述

    我们今天主要向大家讲述的是SQL Server数据库之向SQL Server自增字段正确的插入值的实际操作步骤,在一般的情况下,我们不能向 SQL Server 数据库自增字段中插入值,如果非要这么干 ...

  7. iOS ----Pods-resources.sh Permission denied

    1:执行指令 chmod a+x "路径(Pods-resources.h文件所在的路径)" 2:cd 进如pods文件夹下面 3:执行指令 第一步: sudo chmod 777 ...

  8. nodejs 安装 postgresql module

    # npm -gd install node-gyp # export PATH=$PATH:/usr/local/pgsql/bin # npm -gd install pg for test: # ...

  9. 【Android 界面效果30】Android中ImageSwitcher结合Gallery展示SD卡中的资源图片

    本文主要是写关于ImageSwitcher结合Gallery组件如何展示SDCard中的资源图片,相信大家都看过API Demo 中也有关于这个例子的,但API Demo 中的例子是展示工程中Draw ...

  10. iOS - UI - UISwitch

    UISwitch //开关    不用设置宽高  有默认宽高 UISwitch * sw = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100,  ...