📅  最后修改于: 2022-03-11 14:59:03.077000             🧑  作者: Mango
function getOffset(el) {
const rect = el.getBoundingClientRect();
return {
left: rect.left + window.scrollX,
top: rect.top + window.scrollY
};
}