DOM之getBoundingClientRect() 方法

使用 getBoundingClientRect() 返回的是对象,其包含: x,y,top,bottom,left,right,width,height。 这些值的具体含义为: x,y                   :表示元素左上角距离视窗的坐标 width、height  :表示元素的框和高(= text 的高度 + border + padding) 注意:下面 4 个属性的值在页面滚
相关文章
相关标签/搜索