Forum Moderators: coopster

Message Too Old, No Replies

How do I record a cursor position?

         

glamdring

9:37 am on Jul 9, 2004 (gmt 0)

10+ Year Member



Not sure if this is the right forum, I guess so, but...

Could someone explain or point me in the direction to understand how to do this :

I am wanting to record the position of the cursor on a users' screen when they click on an image - for example, if the user was choosing a spot-the-ball competition, I want to record the co-ordinates they put in via a mouse click, and pass this value over as a six-figure (eg 123,456) value to a hidden field in a form.

Dont know where to start to be honest, so any help would be great.

Thanks a lot.

knighty

9:49 am on Jul 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think Flash would be your best bet as this can track mouse co-ordinates easily

Mr_Brutal

9:52 am on Jul 9, 2004 (gmt 0)

10+ Year Member



Hi try googling for

javascript mouse co-ordinates

and try the top one. (Oh yeah UK search but should be OK)

HTH

edit_g

10:04 am on Jul 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's a way to do this in html - ad serving technology used to pass this automatically when users clicked.

Server side image maps:

[google.com...]

Check result number 7 for an example.

Alternative Future

10:05 am on Jul 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is another example [weblogz.com...]

-George

glamdring

10:31 am on Jul 9, 2004 (gmt 0)

10+ Year Member



Wow. Thanks for the replies - wasnt expecting such a flurry quite so quickly.

httpwebwitch

2:47 pm on Jul 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you use <input type="image">, the cursor coordinates from the click show up in the posted form collection. Is it a browser-specific thing? No idea. Frankly I never use that method, I don't consider it reliable.

I would use Flash. it has built-in properties: _xmouse and _ymouse.