获取元素到页面顶部的距离
function getDisTop(element) { //获取元素距离页面顶部的距离
var realTop = element.offsetTop;
var parent = element.offsetParent;
while (parent !== null) {
realTop += parent.offsetTop;
parent = parent.offsetParent;
}
return realTop;
}