Skip to content

Element.getBoundingClientRect()

Element.getBoundingClientRect() 方法返回一个 DOMRect 对象,其提供了元素的大小及其相对于视口的位置

return:

  • x, y
  • left, top, right, bottom
  • width, height

图例

2025( )
Powered by Snowinlu | Copyright © 2024- | MIT License