In chrome canary, layerX and layerY are deprecated, but what should we use instead ?
I’ve find offsetX but it doesn’t work with Firefox. So to get layerX without warning on webkit, I’ve done that :
var x = evt.offsetX || evt.layerX,
y = evt.offsetY || evt.layerY;
But this seem quite complex ! Is that really what we should do to get layerX working in all browsers ?
Here is a function to calculate layerX and layerY from a click event:
Thanks a lot to Stu Cox for pointing out the two functions used to make this one.