编程语言/getBoundingClientRect:修订间差异
来自康健生活
| 第3行: | 第3行: | ||
<blockquote><pre> | <blockquote><pre> | ||
Element.getBoundingClientRect() 方法返回元素的大小及其相对于视口的位置。</pre></blockquote> | Element.getBoundingClientRect() 方法返回元素的大小及其相对于视口的位置。</pre></blockquote> | ||
=== DOMRect === | |||
这个对象是由该元素的 getClientRects() 方法返回的一组矩形的集合。 | |||
[[文件:GetBoundingClientRect.png|600px|getBoundingClientRect]] | |||
== 参考 == | == 参考 == | ||
* https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect | * https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect | ||