📌  相关文章
📜  如何在 jquery 中获取元素位置 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:41.179000             🧑  作者: Mango

代码示例1
.offset() will return the offset position of an element as a simple object, eg:

var position = $(element).offset(); // position = { left: 42, top: 567 }
You can use this return value to position other elements at the same spot:

$(anotherElement).css(position)