标签:
function getRect(element) { var rect = element.getBoundingClientRect(); var top = document.documentElement.clientTop; var left = document.documentElement.clientLeft; return { top : rect.top - top, bottom : rect.bottom - top, left : rect.left - left, right : rect.right - left } }
标签:
原文地址:http://www.cnblogs.com/fangxuele/p/5430741.html