Mouse Location

Is the only way to get the mouse location by using javascript? Or does
rails do it for me?!? :slight_smile:

Does anyone have a simple script that they use? I’m trying to put a div
right where the mouse is clicked on a link… so I’m looking for it to
work like this:

a hre f=. onclick=Element.setStyle(‘title_login’, {left:
MOUSEX,top:
MOUSEY;});new Effect.toggle(‘title_login’,‘appear’);return
false;">Login</a

The other thing I’m wondering, is how would I reference the javascript
variables MOUSEX and MOUSEY in that line of code?

Or is there a better way to do this?

-Ben L.

p.s. how do i post that full h ref without all the weird modifications?
this forum keeps yelling at me because:
Your post seems to contain Spam: “”.

Ben L. wrote:

Is the only way to get the mouse location by using javascript? Or does
rails do it for me?!? :slight_smile:

Does anyone have a simple script that they use? I’m trying to put a div
right where the mouse is clicked on a link… so I’m looking for it to
work like this:

a hre f=. onclick=Element.setStyle(‘title_login’, {left:
MOUSEX,top:
MOUSEY;});new Effect.toggle(‘title_login’,‘appear’);return
false;">Login</a

The other thing I’m wondering, is how would I reference the javascript
variables MOUSEX and MOUSEY in that line of code?

Or is there a better way to do this?

-Ben L.

p.s. how do i post that full h ref without all the weird modifications?
this forum keeps yelling at me because:
Your post seems to contain Spam: “”.

Am I being vague? Does that code segment make no sense? (I had to take
some things out of it, or it wouldn’t let me post). I’m just trying to
find out how to use a javascript to get the mousex and mousey position,
then use it in an onclick call that uses a prototype
Element.setStyle(‘element’,{left: mouseX, top: mouseY})

-Ben L.

Rails is a server side technology. The only way to deal with the user’s
mouse is to use Javascript.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs