[Greasemonkey] Finding Mouse Coordinates
Arvid Jakobsson
arvid.jakobsson at gmail.com
Thu Jan 26 09:41:59 EST 2006
var link = document.getElementById('yourlink');
link.addEventListener('click', function (event) {
alert(event.mousex);
alert(event.mousey);
}, false);
Haven't tested it though.
2006/1/25, Brendan Crosser-McGay <verifex at gmail.com>:
>
> I thought I tried that, maybe I'm not sure how to pull the mouseclick
> event
> just from a link. :)
>
> On 1/24/06, Arvid Jakobsson <arvid.jakobsson at gmail.com> wrote:
> >
> > Then why don't use the mouseclick event that is generated when someone
> > clicks that link? I guess it has the mousex and mousey values as well.
> Or
> > have I completly misunderstood your problem?
> >
> > 2006/1/25, Brendan Crosser-McGay <verifex at gmail.com>:
> > >
> > > On this script: http://userscripts.org/scripts/show/1434
> > >
> > > In the script for making a transparent draggable window, I need the
> > mouse
> > > event to be able to drag it around properly. The only place I've
> found
> > > the
> > > mousex and mousey values seem to be inside that event. My dilemma is,
> I
> > > want a link on the page that will reposition this draggable window
> > element
> > > to the exact place where the mouse is, which is right at the link.
> > >
> > > The only half-usable solution I've managed to come up with, is one
> where
> > > on
> > > the click, it reinitializes the entire window at the mouse position,
> but
> > > it
> > > still requires the mouse to be moved before the element actually
> changes
> > > coordinates.
> > >
> > > Thanks,
> > > Brendan
> > >
> > > _______________________________________________
> > > Greasemonkey mailing list
> > > Greasemonkey at mozdev.org
> > > http://mozdev.org/mailman/listinfo/greasemonkey
> > >
> > >
> > >
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
>
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
>
>
More information about the Greasemonkey
mailing list