Element.getBoundingClientRect()
Element.getBoundingClientRect()
方法返回一个 DOMRect
对象,其提供了元素的大小及其相对于视口的位置。
参考:
https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
Element.getBoundingClientRect()
方法返回一个 DOMRect
对象,其提供了元素的大小及其相对于视口的位置。
参考:
https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect