Posted in Javascript onApril 16, 2013
function offsetTop( elements ){ var top = elements.offsetTop; var parent = elements.offsetParent; while( parent != null ){ top += parent.offsetTop; parent = parent.offsetParent; }; return top; }; function offsetLeft( elements ){ var left = elements.offsetLeft; var parent = elements.offsetParent; while( parent != null ){ left += parent.offsetLeft; parent = parent.offsetParent; }; return parent; };
获取offsetTop和offsetLeft值的js代码(兼容)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@