js里取容器大小、定位、距离等属性搜集整理

时间:2013-08-19    点击:115   

element.clientWidth   //元素的实际宽度,不算边框

element.clientHeight  //元素的实际高度,不算边框


element.offsetWidth   //元素的实际宽度,加上边框

element.offsetHeight  //元素的实际高度,加上边框


element.scrollWidth  //这个说法很多,我测试下来应该是元素实际宽度-滚动条的宽度

element.scrollHeight  //这个说法很多,我测试下来应该是元素实际高度-滚动条的高度


element.offsetLeft   //相对于父对象的距离,ie下如果position设为relative,则是相对于window的距离

element.offsetTop   //相对于父对象的距离,ie下如果position设为relative,则是相对于window的距离


window.screenLeft   //当前窗口距离屏幕距离 only for IE

window.screenX   //当前窗口距离屏幕距离 not for IE


window.innerWidth  //当前窗口大小(内)not for IE

window.outerWidth  //当前窗口大小(外)not for IE


window.screen.width //当前屏幕分辨率

window.screen.availWidth //当前屏幕可用分辨率

html页面显示年月日时分秒和星期几的两种方式
网页中可关闭的漂浮窗口实现可自行调节
js判断选择的时间是否大于今天的代码
JQuery获取样式中的background-color颜色值的问题
jquery indexOf使用方法
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved