Improve cross-browser compatibility by using pageX/pageY for event position.