Working with the mouse within Javascript I have occasionally met the following event attributes:
- clientX, clientY
- layerX, layerY
- offsetX, offsetY
- pageX, pageY
- screenX, screenY
- x, y
I’m wondering what their cross-browser compatibility looks like in general, as I have only found bits and pieces of info that I’m trying to patch up together.
Here is how jQuery does it :
Testing pageX (or pageY) or calculating it from clientX and scrollLeft ans clientLeft