JS性能

时间:2014-06-20 17:11:58   收藏:0   阅读:197

获取以下属性  会等待对应元素渲染完成  才继续执行

* offsetTop, offsetLeft, offsetWidth, offsetHeight
* scrollTop, scrollLeft, scrollWidth, scrollHeight
* clientTop, clientLeft, clientWidth, clientHeight
* getComputedStyle() (在IE中为currentStyle)

 

PS 如果该元素display为none 或者其父元素display为none  总之该元素没有显示在浏览器中  这些属性得到的值都是0

JS性能,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!