jquery help

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

jquery help

Raoul Duke
hi,

i'm trying to get mouse event positions, and use the offset of the div
so i can find out where in the div the event x,y was.

looking at:

http://stackoverflow.com/questions/4249648/jquery-get-mouse-position-within-an-element

and

http://docs.jquery.com/Tutorials:Mouse_Position

i am trying to use JQuery.This() but it gives me the haxe method,
rather than the DOM DIV...

-Mr. Clueless.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: jquery help

Dion Whitehead Amago
Using jQueryExtern haxelib:

var os :{top:Float, left:Float} = new JQuery("#" + divId).offset();

On Fri, Sep 9, 2011 at 9:46 PM, Raoul Duke <[hidden email]> wrote:

> hi,
>
> i'm trying to get mouse event positions, and use the offset of the div
> so i can find out where in the div the event x,y was.
>
> looking at:
>
> http://stackoverflow.com/questions/4249648/jquery-get-mouse-position-within-an-element
>
> and
>
> http://docs.jquery.com/Tutorials:Mouse_Position
>
> i am trying to use JQuery.This() but it gives me the haxe method,
> rather than the DOM DIV...
>
> -Mr. Clueless.
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: jquery help

Raoul Duke
hi,

thanks! will try that!

might anybody have info on how "$(this)" ends up working in haxe vs.
raw javascript? the javascript examples on the web make it looks like
the "this" resolves to the div that has the event function attached to
it when they are called, whereas i get the haxe method in the haxe
object when it is called in my haxe->js build. so i guess there's
something about scoping going on with the haxe JQuery.This() approach?
i did look at final js sources but haven't groked it yet.

sincerely.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: jquery help

Nicolas Cannasse
Le 10/09/2011 14:20, Raoul Duke a écrit :
> hi,
>
> thanks! will try that!
>
> might anybody have info on how "$(this)" ends up working in haxe vs.
> raw javascript?

You can use js.JQuery.cur , which will do exactly the same.

Nicolas

--
haXe - an open source web programming language
http://haxe.org