标签:
1、获得元素到页面的绝对距离
1 function getPos(obj) { 2 var pos = {left:0, top:0}; 3 while (obj) { 4 pos.left += obj.offsetLeft; 5 pos.top += obj.offsetTop; 6 obj = obj.offsetParent; 7 } 8 return pos; 9 }
标签:
原文地址:http://www.cnblogs.com/liujin0505/p/5814140.html