Click to See Complete Forum and Search --> : get parentNode offset on onmouse event


crs
05-09-2003, 07:43 AM
Does anyone know hot to get offsetY from parentNode.

Sample:

function my_call(my_object)
{
status = window.event.offsetY; <- this work
status = window.event.srcElement.parentNode.offsetY; <- need to get, but doesn't work
}


<div>
<div onmousedown="my_call(this)">...</div>
</div>

Thanx in advance

khalidali63
05-09-2003, 07:51 AM
offsetY isn't right,it should be offsetTop or offsetLeft

crs
05-09-2003, 08:05 AM
OffsetTop and OffsetLeft sounds great.

Outer object in my case is not DIV, but TD, where I cannot get top left position trough style, since I have used %.

But I think that OffsetTop will be applicable.

Thank you again to both of you... but if you have anothe tip/clue I would be more than happy.

crs
05-09-2003, 08:14 AM
Oh... one more question...

window.event.srcElement.offsetTop
gives me top offset (obvious :)) to its parent but how to get absolute offset to the BODY ?

Thanx again in advance

crs
05-12-2003, 08:59 AM
Thank you guys... you make my day :)

I have another one, but I will post a new thread.