📅  最后修改于: 2022-03-11 15:04:33.484000             🧑  作者: Mango
var d = document.getElementById("div1");
var topPos = d.offsetTop;
if (topPos > 10) {
// object is offset more
// than 10 pixels from its parent
}