获取元素在文档document的位置
摘要:
<textarea>function getLocation(element) { if(element == null) return null; var offsetTop = element.offsetTop; var offsetLeft = element.offsetLeft; while(element = element.offsetParent) { offsetTop += element.offsetTop; offsetLeft += element.offsetLeft; } var o = {}; o.left = offsetLeft; o.top 阅读全文
posted @ 2012-05-10 15:02 TonyCoolZhu 阅读(1217) 评论(0) 推荐(0) 编辑