Difference between layerX and offsetX in JavaScript
问题 There are different co-ordinate system for JavaScript, such as e.clientX, e.screenX. I understand those two well, but there are some like e.layerX and e.offsetX. These two are not very clear to me. Can someone explain those two co-ordinates for me? 回答1: offsetX / offsetY are a neat extension by Microsoft to mouse event objects, and mean the position of the mouse pointer relatively to the target element. Sadly, they're not implemented by Firefox, and there's discordance among the other