【摘要】获得HTML元素的绝对位置

function findAbsolutePosition(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
//returns an array
}

原文地址:http://vikku.info/codesnippets/javascript/find-absolute-position-of-an-html-element/
上一篇:NodeJS Stream流


下一篇:FreeBSD 配置