how to show x y coordinates of the cursor

W

wai-tak sit

can anybody tell me how can the webpage shows the x y coordinates of the
cursor when I click on the web page?

Thanks in advance.
 
W

wai-tak sit

Dear Roy,

Thanks for help!

What if I want to show the xy coordinates in tooltips whenever the mouse
land over.

Thanks again.

Wai Tak

==================================


Roy said:
__/ [wai-tak sit] on Sunday 15 January 2006 09:27 \__

can anybody tell me how can the webpage shows the x y coordinates of the
cursor when I click on the web page?

Thanks in advance.


This can become very obtrusive, but there you go:

http://javascript.internet.com/page-details/mouse-coordinates.html

Hope it helps,

Roy
 
T

Toby Inkster

wai-tak sit said:
can anybody tell me how can the webpage shows the x y coordinates of the
cursor when I click on the web page?

You're opening a Pandora's box here!

Say I'm viewing a web page like this:

__________________________
| |
| Document |
|__________________________|
|x |
| Viewport |
| |
| |
| |
| |
| |
| |
|____________________________|
| |
| |
|__________________________|


That is, I've opened you web page and scrolled down a little way, so that
the top of your document has scrolled off the top of my screen.

If I click in the position marked "x", how far down the page am I? Zero
lines, because I'm at the top of my viewport; or four lines, because I've
scrolled down three lines of your document?

The problem is that when you use Javascript to determine the mouse
position, some browsers report the position relative to the viewport, and
some relative to the document.

Read more here:
http://www.evolt.org/article/Mission_Impossible_mouse_position/17/23335/index.html
 
Joined
Sep 9, 2006
Messages
1
Reaction score
0
okay srry to be total noob about this but how do i install the script into the web page so i can see x y cordnents on the web page srry again for this being so noobish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top