Skip to content

getRect ​

获取元素或窗口的尺寸和位置,返回一个 DOMRect 对象。

使用 ​

ts
import { getRect } from 'rattail'

const rect = getRect(document.querySelector('div'))

参数 ​

参数类型默认值
elementElement

返回值 ​

类型
DOMRect