Is the only way to get the mouse location by using javascript? Or does rails do it for me?!? :) 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 Lisbakken 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: "". -- Posted via http://www.ruby-forum.com/.
Ben Lisbakken wrote:> Is the only way to get the mouse location by using javascript? Or does > rails do it for me?!? :) > > 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 Lisbakken > > 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 Lisbakken -- Posted via http://www.ruby-forum.com/.
Rails is a server side technology. The only way to deal with the user''s mouse is to use Javascript. On 7/19/06, Ben Lisbakken <lisbakke@gmail.com> wrote:> > Ben Lisbakken wrote: > > Is the only way to get the mouse location by using javascript? Or does > > rails do it for me?!? :) > > > > 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 Lisbakken > > > > 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 Lisbakken > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060720/4a2cf46a/attachment.html