Nevermind, I was using event.clientX instead of Event.pointerX(event)
On Oct 10, 12:48 pm, arty
<atregoube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi!
>
> I need to detect whether mouse event happened over specific element.
> There''re 2 methods to work with this in Prototype:
Position''s within()
> and withinIncludingScrolloffsets(). My page is long and may be
> scrolled, so within() is no option for me. However
> withinIncludingScrolloffsets() also doesn''t work as I expect. The
> problem is in these lines:
>
> var offsetcache = this.realOffset(element);
> this.xcomp = x + offsetcache[0] - this.deltaX;
> this.ycomp = y + offsetcache[1] - this.deltaY;
>
> In my simple case (only page itself may be scrolled) offsetcache
> values are always just equal to corresponding deltas. Thus xcomp and
> ycomp become equal to x and y, so withinIncludingScrolloffsets()
> doesn''t differ in any way from within(), and doesn''t help
me neither.
>
> However if I comment out deltas subtraction, everything works just
> fine. Looks like deltas were intended to fix the situation when
> realOffset() didn''t take page scroll offsets for some reason, but
now
> it does.
>
> Is this a bug? Or maybe i''m missing something?
>
> Tests were performed in Firefox/2.0.0.6 with Firebug.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---