最新文章列表

getBoundingClientRect(),clientTop,clientHeight,offsetTop,offsetHeight的介绍

getBoundingClientRect(),clientTop,clientHeight,offsetTop,offsetHeigh,pageYOffset这几个属性大家肯定经常用到,相关的用法网上也能找到很多资料,在这里就重新复习一下它们的用法,这是测试的html: <!DOCTYPE html> <html> <head> <met ...
neitingbbb 评论(0) 有51人浏览 2017-06-15 21:35

scrollHeight、clientHeight ,offsetHeight 区别

我认为我们想要两个东西:   一是 scrollWidth(scrollHeight),虽然它用处不大,但应该比 offsetWidth(offsetHeight)有用得多。它表示的是文档区的宽度(高度),比如一个网页,特别是门户网站,拖很长,就要把没有显示出来的内容都计算进去。 二是视口 viewport,就是 clientWidth,就是窗口中可显示内容的那块区域,就是我们常常看 ...
accpxudajian 评论(0) 有1548人浏览 2012-11-22 10:00

关于clientWidth,clientHeight,offsetWidth,offsetHeight 等属性的意思

  网页可见区域宽:document.body.clientWidth;  网页可见区域高:document.body.clientHeight;  网页可见区域宽:document.body.offsetWidth;(包括边线的宽) 网页可见区域高:document.body.offsetHeight;(包括边线的宽) 网页正文全文宽:document.body.scrollWidth; ...
cruih 评论(1) 有5669人浏览 2012-09-28 14:37

常用脚本

换行:  -word-wrap:break-word; word-break:break-all; 半透明:  -filter:alpha(opacity=60);-moz-opacity:0.5;opacity: 0.5;   获取当前窗口的父窗口内的方法(譬如myfun): - window.parent.window.myfun('abc');   父窗口获取子窗口的函数(譬 ...
accpxudajian 评论(0) 有974人浏览 2012-09-03 18:28

jQuery,javascript获得网页的高度和宽度(转)

网页可见区域宽: document.body.clientWidth 网页可见区域高: document.body.clientHeight 网页可见区域宽: document.body.offsetWidth (包括边线的宽) 网页可见区域高: document.body.offsetHeight (包括边线的高) 网页正文全文宽: document.body.scrollWidth 网页正文全文 ...
一刀3段 评论(0) 有1588人浏览 2012-07-04 11:04

前端开发中的各种width,height

var s = ""; s += "\r\n网页可见区域宽:"+ document.body.clientWidth; s += "\r\n网页可见区域高:"+ document.body.clientHeight; s += "\r\n网页可见区域宽:"+ document.body.offsetWidth +& ...
指甲刀X 评论(0) 有1024人浏览 2012-02-16 17:39

Javascript 获取页面高度(多种浏览器)【转】

本文源为:http://developer.51cto.com/art/200805/72909.htm 关于获取各种浏览器可见窗口大小的一点点研究。 在我本地测试当中: 在IE、FireFox、Opera下都可以使用 document.body.clientWidth document.body.clientHeight 即可获得,很简单,很方便。 而在公司项目当中: Opera仍然使用 do ...
BBjava 评论(0) 有881人浏览 2011-09-27 01:19

最近博客热门TAG

Java(141744) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54919) .net(54785) Web(54514) 工作(54118) Linux(50905) Oracle(49875) 应用服务器(43289) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37267) 数据结构(36424)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics