Element.getBoundingClientRect() 方法返回元素的大小及其相对于视口的位置。

370 阅读1分钟

developer.mozilla.org/zh-CN/docs/…