I'm playing around with a HTML5 game and I want to have the mouse position controlled by the canvas not the page.
I'm using e.offsetX
and e.offsetY
, which works as it should in Google Chrome, Safari but not in Firefox.
I'm not sure what the problem is. I have given the canvas tag position: relative
.
Here is my code.