HansAtWork
08-11-2005, 12:23 PM
Hello,
I want to capture the mouseposition when an image is clicked. I get it in IE like this:
posx = window.event.offsetX
posy = window.event.offsetY
In case off click on the upper left corner of the image, result is posx=0, posy=0.
This does not work in FireFox. (offsetX and offsetY do not exist ).
I tried this for handling the onclick event:
function HandleMapClick(e)
{
posx = e.layerX;
posy = e.layerY;
}
However, this seems to give the mouseposition calculated from the upper
left corner of the browser. I want it from the upper left corner off the image.
Can anyone help me? Thanks in advance!
I want to capture the mouseposition when an image is clicked. I get it in IE like this:
posx = window.event.offsetX
posy = window.event.offsetY
In case off click on the upper left corner of the image, result is posx=0, posy=0.
This does not work in FireFox. (offsetX and offsetY do not exist ).
I tried this for handling the onclick event:
function HandleMapClick(e)
{
posx = e.layerX;
posy = e.layerY;
}
However, this seems to give the mouseposition calculated from the upper
left corner of the browser. I want it from the upper left corner off the image.
Can anyone help me? Thanks in advance!