client offset scroll 之间的区别】的更多相关文章

一.client 属性 值 clientWidth 元素被设置的宽度 + padding左右内间距 clientHeight 元素被设置的高度 + padding上下内间距 clientLeft 左 边框的宽度 clientTop 上 边框的宽度 二.offset 属性 值 offsetWidth 元素被设置的宽度 + padding左右内间距 + 左右边框的值 offsetHeight 元素被设置的高度 + padding上下内间距 + 上下边框的值 offsetLeft 元素外边距离父级左内…
DOM盒模型和位置 client offset scroll 和滚动的关系 概览 在dom里面有几个描述盒子位置信息的值, pading border margin width height client clientWidth 不要border clientHeight 不要border offset offsetTop offsetLeft offsetWidth  要border offsetHeight  要border scroll scrollTop scrollHeight scr…
知识点: 模拟滚动条的解除事件问题 : event内置对象,包含 了大量事件: page兼容性: pageX || clientX + scool().top  : if (true === a)true 最好写前边: window.screen.width/height : 检测屏幕分辨率: 屏幕宽高: window.screen.width.     window.screen.height : 可视区域宽高兼容性写法: function client(){ if (window.inner…
offset偏移(返回的是number类型) offsetLeft:返回盒子距离左边的距离 offsetTop:返回盒子距离顶部的距离 offsetHeight:返回盒子的高度,包括border,padding,不包括margin; offsetWidth:返回盒子的宽度,包括border,padding,不包括margin; offsetX: offsetY: offsetParent:找到有定位的父元素 offset与style.top的区别: 1.offset可以返回没有定位的盒子距离左边…
原文地址:http://caibaojian.com/js-name.html JS中获取各种宽度和距离,常常让我们混淆,各种浏览器的不兼容让我们很头疼,现在就在说说js中有哪些宽度和距离. 1.名词解释 screen:屏幕.这一类取到的是关于屏幕的宽度和距离,与浏览器无关,应该是获取window对象的属性. client:使用区.客户区.指的是客户区,当然是指浏览器区域. offset:偏移.指的是目标甲相对目标乙的距离. scroll:卷轴.卷动.指的是包含滚动条的的属性. inner:内部…
原文地址:→传送门 window相关宽高属性 1. window.outerHeight (窗口的外层的高度) / window.outerWidth (窗口的外层的宽度) window.outerHeight获取整个浏览器窗口的高度(单位:像素),包括侧边栏(如果存在).窗口镶边(window chrome)和窗口调正边框.包含调试窗及浏览器边框 window.outerWidth表示整个浏览器窗口的宽度,包括侧边栏(如果存在).窗口镶边(window chrome)和调正窗口大小的边框.包含…
1. client 系列 示例 : <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .box{ width: 200px; height: 200px; position: absolute; border: 10px solid red; /*m…
client(客户端),offset(偏移),scroll(滚动)1.client系列 clientTop 内容区域到边框顶部的距离 ,说白了,就是边框的高度 clientLeft 内容区域到边框左部的距离,说白了,就是边框的宽度 clientWidth 内容区域+左右padding 可视宽度 clientHeight 内容区域+ 上下padding 可视高度 例: <head> <meta charset="UTF-8"> <title>Title…
Window: window.innerWidth:浏览器viewport视口宽,包括垂直滚动条 window.innerHeight:浏览器视口高,包括水平滚动条 window.outerWidth: 获取浏览器窗口外部的宽度.表示整个浏览器窗口的宽度,包括侧边栏(如果存在).窗口镶边(window chrome)和调正窗口大小的边框 window.outerHeight:获取整个浏览器窗口的高度(单位:像素),包括侧边栏(如果存在).窗口镶边(window chrome)和窗口调正边框(wi…
HTML元素有几个offset.client.scroll开头的属性,总是让人摸不着头脑.在书中看到记下来,分享给需要的小伙伴.主要是以下几个属性: 第一组:offsetWidth,offsetHeight,offsetLeft,offsetTop,offsetParent  第二组:clientWidth,clientHeight,clientLeft,clientTop 第三组:scrollWidth,scrollHeight,scrollLeft,scrollTop 详细定义如下: 1.1…