How To Get X,Y Coord's Like "ismap" ?

Jul 23, 2005

I need to make some calculations (in a client-side script) based on
the X,Y coordinates of the mouse pointer when the user clicks on an
image. I want the coordinates to be screen-resolution independent.

The image tag's "ismap" generates exactly the numbers I'm looking for
but I can't figure out how to capture them. "ismap" seems to work only
when used in conjunction with an "href" and a new page is
automatically requested. Is there a way to grab those numbers without
requesting a new page?

Alternatively, can someone tell me how to generate the equivalent
numbers?

I've tried looking at just about every X and Y related property on the
"image" and "event" objects but I can't seem to duplicate the "ismap"
numbers.

View 9 Replies


ADVERTISEMENT

I Want To Get ISMAP Coordinates

Mar 6, 2005

I'm trying to build a simple image-map-creation tool for a web-based app I'm making. (User selects an image, then clicks on it to set image map areas; initially could be just RECTANGLE, later want CIRCLE and POLYGON.)

The quickest "solution" was to display the image with anchor tags, with the ISMAP option on. This causes the x/y coordinates to be displayed in the status bar, at the end of the URL. Sweet, but I'd like to be able to tell when the user clicks, and then grab those values. Then I can build a text string holding their selected area, etc. (It'd be great if I could show the selected area with a box or something, too, but that may require doing it in PHP, building images, etc.) Anyway, does anyone know how I can get the X/Y coordinates when the user clicks? Since it's in a form, can I do something with input types to get the values?

View 2 Replies View Related

Getting Mouse Coords Onclick Relative To Image

Aug 4, 2006

I am trying to create a javascript that will return the coords of where the mouse clicked on an image. I know there are script that will do this sort of thing but they always return the value relative to the whole document (top left of browser screen is 0,0) i would like the coordinates relative to the image (topleft of image is 0,0)

View 1 Replies View Related

Cursor Coords - Print Out The X And Y Of The Mouse On The Screen

Feb 24, 2010

I need a javascript that will print out the X and Y of the mouse on the screen as I move the mouse and keep up to date. The X and the Y must also be stored in a variable. (Trying to increase my knowledge of javascript so that I can make my web sites better and my experiments are all in making games)

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved