[Seaside] Image Zoomer: How to capture mouseOver X & Y

Robert Sirois watchlala at hotmail.com
Sat Apr 3 05:15:40 UTC 2010


Ugh, I give up. For some reason this is easy to do in Prototype, but I can't figure it out at all in jQuery...

What I'd like to do is get the position of the mouse (http://docs.jquery.com/Types/Event#event.pageX.2FY) and send the value to an ajax callback like below:

...
        onClick: (html jQuery ajax
            callback: [:v | self session mousePosTop: v ] value: 'y val';
            callback: [:v | self session mousePosLeft: v ] value: 'x val'
        );
...

Near as I can tell, in PT you have access to the actual event parameter via the PTEvent class, which doesn't seem to exist in jQ, but the part I'm confused about is that both implement #call:with: on JSObject, but I guess the JavaScript libraries respond differently.

jQuery uses pageX/pageY quite extensively (especially UI), so I would think they would have a function returning those values?

Thanks,
RS

> From: renggli at gmail.com
> Date: Fri, 2 Apr 2010 20:19:24 +0200
> Subject: Re: [Seaside] Image Zoomer: How to capture mouseOver X & Y
> To: seaside at lists.squeakfoundation.org
> 
> > How do you get the offset from the window or client?
> 
> window.left
> window.top
> 
> Lukas
> 
> 
> >
> > RS
> >
> >> From: renggli at gmail.com
> >> Date: Fri, 19 Mar 2010 08:23:57 +0100
> >> Subject: Re: [Seaside] Image Zoomer: How to capture mouseOver X & Y
> >> To: seaside at lists.squeakfoundation.org
> >>
> >> > This works nicely but I haven't been able to work out to to pass the
> >> > relative X & Y positions from the mouseover on the original image into
> >> > the cssClippedPosition method.
> >>
> >> What Javascript library are you using?
> >>
> >> For jQuery:
> >> http://www.electrictoolbox.com/jquery-mouse-co-ordinates-mouseover-click-within-element/
> >> In General:
> >> http://www.google.ch/search?q=mouse+coordinates+relative+to+element
> >>
> >> Lukas
> >>
> >> --
> >> Lukas Renggli
> >> http://www.lukas-renggli.ch
> >> _______________________________________________
> >> seaside mailing list
> >> seaside at lists.squeakfoundation.org
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> > ________________________________
> > Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> > Learn more.
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> 
> 
> 
> -- 
> Lukas Renggli
> www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100402/682794b8/attachment.htm


More information about the seaside mailing list