Coordinates of an onMouseOut event

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I am trying to get the page relative coordinates of an onMouseOut event.
With all the different coordinate properties (some just returning undefined)
and browser versions I have seen, I am pulling my hair out trying to find
one that gives the value I want. It would also be nice if anyone knew of a
page that had a good reference of the different JavaScript coordinate
properties (which ones are properties of which objects, and which ones are
screen relative, source relative, and page relative). Thanks.
 
Hi Nathan

What about event.clientX and event.clientY? They worked for me. Note the
capital X and Y! These things catch one out by being case sensitive!

David Robinson
 
event.clientX & event.clientY are screen-relative, which means that
depending on how far down the user has scrolled they might give different
values.
 
Nathan said:
I am trying to get the page relative coordinates of an onMouseOut
event. With all the different coordinate properties (some just
returning undefined) and browser versions I have seen, I am pulling
my hair out trying to find one that gives the value I want. It would
also be nice if anyone knew of a page that had a good reference of
the different JavaScript coordinate properties (which ones are
properties of which objects, and which ones are screen relative,
source relative, and page relative). Thanks.

Have you seen (for IE anyway)...

Measuring Element Dimension and Location
<http://msdn.microsoft.com/workshop/author/om/measuring.asp?frame=true>
 
I have, but I don't think all of those values are set when the onMouseOut
event is triggered (the example shown there is triggered with the onClick
event).
 
Back
Top