1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Rep Power

    i`m looking for a peice of code to get the X & Y co-ords of an image or Anchor in Javascript, i figuire its got to be possible.. i`m just not entirely sure how.. if anyone could help me out here it would be much appreciated

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Rep Power
    Yes, you can! I have an example at http://www.sitesuwant.com/exampleXY.html. You can get the x and y of an image with this code inside the script tag:


    In the body:

    <b>Click X:</b> <input type="Text" name="xCoor" disabled><br>
    <b>Click Y:</b> <input type="Text" name="yCoor" disabled>

    ...and that should give you the proper response. This will only work in Internet Explorer 3+ I believe, so if you want Netscape too, tell me and I'll try to figure something out in Javascript for Netscape...

    Devin www.sitesuwant.com

    [This message has been edited by kenowhere (edited September 04, 2000).]

Similar Threads

  1. Replies: 0
    Last Post: January 6th, 2004, 03:05 PM
  2. External JavaScript file problem
    By FTK2003 in forum JavaScript Development
    Replies: 11
    Last Post: September 13th, 2003, 12:21 PM
  3. External JavaScript file from within a JavaScript function?
    By DKDiveDude in forum JavaScript Development
    Replies: 10
    Last Post: August 19th, 2003, 04:24 AM
  4. delimiting javascript
    By scream in forum JavaScript Development
    Replies: 3
    Last Post: August 15th, 2003, 05:03 PM
  5. getting javascript error when using PHP and javascript
    By Dalamar in forum JavaScript Development
    Replies: 8
    Last Post: December 17th, 2001, 08:41 AM

IMN logo majestic logo threadwatch logo seochat tools logo