js_getBoundingClientRect

	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
		}
   }

 

posted @ 2016-04-25 14:02  天桥残局  阅读(226)  评论(0编辑  收藏  举报