On 5/30/2011 11:22 AM, Eric wrote:
Hi Bill,

Using Event.PointerX() and Event.PointerY() you can get the absolute
position of the mouse on the page.
Using Element.Layout you can get the exact position of your image.

If you substract the layout's left value to PointerX and the layout's
top value to PointerY, you should have the X/Y position relative to
top/left corner of your image.

More simple but I am not sure it is crossbrowser supported, events
*may* have clientX and clientY attributes which *may* contain what
you're looking at (if your event is attached to the img DOM object).
I can use clientX/Y or pageX/Y to get the location of the mouse, but I can't figure out how to get the scroll of the _DIV_. I looked at the options available for Element, but which will give me the amount that the contents of the _DIV_ have scrolled.
pageX/Y gives me the amount the body is scrolled, not the _DIV_.

Bill Drescher
william {at} TechServSys {dot} com

You received this message because you are subscribed to the Google Groups "Prototype 
& script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to