I had a problem, I had a div with a class of .grid with a couple of images in it and wanted to right click on one image to make a bigger one appear and then with a mousemove event make that image fallow my cursor finally with a mouseleave event when I switched image, the bigger image would leave.
I tried using pageX and pageY events to determine the possition of the bigger image but the image would appear like almost a 1000 pixel further to the right.
I finally found a solution here on css-tricks (https://css-tricks.com/snippets/jquery/get-x-y-mouse-coordinates/), it works, but I don’t know why. There is no explanations. I was wondering if you could explain to me why this work and why do you need to do this in order for pageX and pageY to work.
Thanks