Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

how to get_absolute_left(float + offsetLeft)

5:29 am on Apr 11, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 19, 2002
votes: 0

there is an example code in msdn that tell u how to calc absolute top/left of a specified element.

function calc...(o) {
var l = o.offsetTop;
var p = o.offsetParent;

while (p!= null) {
if (ie && p.tagName == "TD") {
l += p.clientTop;
l += p.offsetTop;
p = p.offsetParent;

but it won't work with

<div style="float: left">abc</div>
<div style="float: right">123</div>
<div style="float: left">def<div id="obj">calc me</div></div>

how do u calc the obj?

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members