scrollHieght、offsetHeight、clientHeight、width、height
1、scroll滚动(scrollTop、Left、Height、Width)
scroll()当用户滚动指定的元素时,会发生 scroll 滚动事件;
scrollWidth、scrollHeight属性表示元素对象真实的宽高;
scrollTop() 方法设置或返回被选元素的垂直滚动条位置。当滚动条位于最顶部时,位置是 0。
scrollHeight-scrollTop=clientHeight;表示垂直滚动条走到底了(前提margin\padding都为0)
2、client 客户端(clientWidth、clientHeight)
浏览器的宽度:document.body.clientWidth;
3、offset偏移(offsetHeight、offsetWidth、offsetTop、offsetLeft)
offsetHeight、offsetWidth:表示当前对象的高、宽。
offsetTop、offsetLeft:表示当前元素对象相对于其定位元素的垂直、水平偏移量;
offset()可返回、可设置元素的偏移坐标
$(selector).offset():获取某元素当前的方位,返回偏移坐标;
$(selector).offset({top:value,left:value})设置偏移坐标
$(selector).offset().left 返回偏移坐标距离左边的位移
$(selector).offset($(selector).offset())使用另一元素的偏移坐标为元素设置偏移坐标
4、$(window).width();获取浏览器的宽度
$(window).height();获取浏览器的高度
$("#xx").width()/height()获取元素的宽度/高度
scrollHieght、offsetHeight、clientHeight、width、height的更多相关文章
- 四种浏览器对 clientHeight、offsetHeight、scrollHeight、clientWidth、offsetWidth 和 scrollWidth 的解释差异
网页可见区域宽:document.body.clientWidth 网页可见区域高:document.body.clientHeight 网页可见区域宽:document.body.offsetWid ...
- 详解clientHeight、offsetHeight、scrollHeight
关于clientHeight.offsetHeight.scrollHeight window.screen.availWidth 返回当前屏幕宽度(空白空间) window.screen.av ...
- clientHeight、offsetHeight、scrollHeight详解
网页可见区域宽: document.body.clientWidth; 网页可见区域高: document.body.clientHeight; 网页可见区域宽: document.body.offs ...
- 关于height、offsetheight、clientheight、scrollheight、innerheight、outerheight的区别一览
平时,不管在pc端页面还是移动端页面,因为我们一般很少会设置某个块的的高度,但是呢,我有时候有需要取到这些高度以便于我们方便进行判断和下一步的编写.一般这个时候我都是直接的获取一个块的高度.heigh ...
- JS中的offsetWidth、offsetHeight、clientWidth、clientHeight等等的详细介绍
javascript中offsetWidth.clientWidth.width.scrollWidth.clientX.screenX.offsetX.pageX 原文:https://www.cn ...
- jquery 对象的 height、innerHeight、outerHeight 的区别以及DOM 元素的 clientHeight、offsetHeight、scrollHeight、offsetTop、scrollTop
前言:jquery 对象的 height.innerHeight.outerHeight,还有 DOM 元素的 clientHeight.offsetHeight.scrollHeight.offse ...
- clientWidth、clientHeight、offsetWidth、offsetHeight以及scrollWidth、scrollHeight
clientWidth.clientHeight.offsetWidth.offsetHeight以及scrollWidth.scrollHeight是几个困惑了好久的元素属性,趁着有时间整理一下 1 ...
- 浏览器中如何获取想要的offsetwidth、、、clientwidth、、offsetheight、、、clientheight。。。
clientWidth是对象看到的宽度(不含边线,即border)scrollWidth是对象实际内容的宽度(若无padding,那就是边框之间距离,如有padding,就是左padding和右pad ...
- JS-scrollTop、scrollHeight、clientTop、clientHeight、offsetTop、offsetHeight的理解
scrollTop, 可写(这些属性中唯一一个可写的元素) Element.scrollTop 属性可以获取或设置一个元素的内容垂直滚动的像素数. 一个元素的 scrollTop 值是这个元素的顶部到 ...
- 转 top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
1.top 此属性仅仅在对象的定位(position)属性被设置时可用.否则,此属性设置会被忽略. 复制代码 代码如下: <div style=" position:absolute; ...
随机推荐
- C#:数据库通用访问类 SqlHelper
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; usin ...
- help手册使用
属性的方法名的一般规律: 设置的属性名: set+属性名 获取属性值: 1.如果是bool类型,可能是 is+属性名 或者 属性名 2.不是bool类型,就是属性名
- iOS开发图片与颜色处理工具
1.根据颜色生成一张图片 /** 根据颜色生成一张图片 @param color 颜色进制 UIColor类型 @return 一张UIImage图片 */ + (UIImage *)createIm ...
- linux 基本概念
Linux把物理内存分为了固定统一大小的块,称为page(页框),一般为4KB. Linux采用4KB页框大小作为标准的物理内存分配单元,内核用数据结构page描述一个页框的状态信息,其实页是进程的概 ...
- mysql 模糊查询 concat()
concat() 函数,是用来连接字符串. 精确查询: select * from user where name=”zhangsan” 模糊查询: select * from user where ...
- SQL语句 ANSI_NULLS 值(ON|OFF)的含义
官方说明: 1.当 SET ANSI_NULLS 为 ON 时,即使 column_name 中包含空值,使用 WHERE column_name = NULL 的 SELECT 语句仍返回零行. 即 ...
- django ORM 连表查询
db_index=True 如果设置该字段就可以设置索引 auto_now_add 代表设置创建时候的时间 auto_now 每次更新数据记录时会更新该字段 to_field 设置要关联表的字 ...
- String转不同type的类对象
import org.springframework.beans.SimpleTypeConverter; private Object deserializeValue(Class<?> ...
- build-helper-maven-plugin
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven ...
- sqlserver 服务器监控
1.表锁 查看被锁的表:select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from ...