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