i need an help, i need to get the coordinates only on image into body. SO this is my dialog with image inside:
the image with the bodys is 400 x 400 px. So there is a method to get coordinates inside image? For example if i click on the center i will get 200 x 200 y.
I tried like this:
document.getElementById("bodyImg").addEventListener('click', function (event) {
// https://stackoverflow.com/a/288731/1497139
var x = event.clientX;
var y = event.clientY;
alert("click on X: " + x + " Y " + y);
});
but return page x and page y... i need to get only the img coordinate.
Thanks.