how to show x y coordinates of the cursor

Discussion in 'HTML' started by wai-tak sit, Jan 15, 2006.

  1. wai-tak sit

    wai-tak sit Guest

    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.
    wai-tak sit, Jan 15, 2006
    #1
    1. Advertising

  2. __/ [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

    --
    Roy S. Schestowitz | Useless fact: Florida is bigger than England
    http://Schestowitz.com | SuSE Linux | PGP-Key: 0x74572E8E
    10:35am up 35 days 17:46, 13 users, load average: 1.06, 1.23, 1.21
    http://iuron.com - next generation of search paradigms
    Roy Schestowitz, Jan 15, 2006
    #2
    1. Advertising

  3. wai-tak sit

    Philip Ronan Guest

    wai-tak sit wrote:

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


    You might find that a server-side image map does what you want:

    <http://www.w3.org/TR/html4/struct/objects.html#h-13.6.2>

    --
    philronan [@] blueyonder [dot] co [dot] uk
    Philip Ronan, Jan 15, 2006
    #3
  4. wai-tak sit

    wai-tak sit Guest

    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 Schestowitz wrote:

    > __/ [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
    >
    wai-tak sit, Jan 15, 2006
    #4
  5. wai-tak sit

    Toby Inkster Guest

    wai-tak sit wrote:

    > 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

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jan 16, 2006
    #5
  6. wai-tak sit

    Thundergo

    Joined:
    Sep 9, 2006
    Messages:
    1
    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
    Thundergo, Sep 9, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VG9tYXMgS2VwaWM=?=

    Changing DEFAULT cursor to WAIT cursor in ASP

    =?Utf-8?B?VG9tYXMgS2VwaWM=?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,316
    Bruce Barker
    Apr 5, 2005
  2. Suresh  Kumar
    Replies:
    0
    Views:
    589
    Suresh Kumar
    Jul 3, 2003
  3. Suresh  Kumar
    Replies:
    0
    Views:
    514
    Suresh Kumar
    Jul 4, 2003
  4. =?Utf-8?B?cm9kY2hhcg==?=

    cursor coordinates relavtive to div

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 17, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    630
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 26, 2007
  5. dmaziuk
    Replies:
    3
    Views:
    573
    Chris Gonnerman
    Jan 25, 2011
Loading...

Share This Page