首页 > 其他 > 详细

getBoundingClientRect用法

时间:2017-09-15 13:21:20      阅读:244      评论:0      收藏:0      [点我收藏+]

getBoundingClientRect()表示元素相对于视窗的集合,left、right、top、bottom(元素的位置)等属性

也可以得到元素的width和height

如: objRect = obj.getBoundingClientRect();

   left = objRect.left;

   right = objRect.right;

   top = objRect.top;

   bottom = objRect.bottom;

   width = right - left;

   height= bottom - top;

  

getBoundingClientRect用法

原文:http://www.cnblogs.com/huanbaby/p/7525734.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!