On 5/31/2011 11:06 AM, Walter Davis wrote:
On May 31, 2011, at 10:57 AM, bill wrote:
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).
Take a look at Element.cumulativeScrollOffset and see if that
can give you what you need. According to the docs, it can
handle multiply-nested scrolling containers.
Walter
I looked at that, but I do not want to account for the scroll of
the body, and cumulativeScrollOffset seems as it would do that.
I need the scroll of the div contents only.
Thanks for the thought
bill
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
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.