I'm currently working with a fairly huge image on a website which serves as a map for a game I'm developing. The image can hold hundreds of rooms in a grid-fashion and I'd like to add in a mouseover function which displays the rooms' coordinates.
I think I'd need to do this is javascript, and I think the first step would be to be able to pin point where, on the image, the mouse is. To do that, I'd need the mouse location, adjusted by the scroll amount, compared to the top right corner of the image. The thing is, I don't know how to get the coordinates of the image I need. The image is just loaded in a normal 'img src' tag and placed in a cell of a table. I'd like to be able to get the coordinate from the image tag alone, but placing a span or div around it would work as well. Any help would be appreciated.
Thanks,
Dave Mittner
I think I'd need to do this is javascript, and I think the first step would be to be able to pin point where, on the image, the mouse is. To do that, I'd need the mouse location, adjusted by the scroll amount, compared to the top right corner of the image. The thing is, I don't know how to get the coordinates of the image I need. The image is just loaded in a normal 'img src' tag and placed in a cell of a table. I'd like to be able to get the coordinate from the image tag alone, but placing a span or div around it would work as well. Any help would be appreciated.
Thanks,
Dave Mittner
Comment