#445 closed enhancement (fixed)
normalise pageX/pageY
Reported by: | sam | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | core | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
As Internet Explorer does not support pageX and pageY it would be useful if the properties could still be used. The workaround I use at the moment is:
if(!event.pageX) { event.pageX = event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft); event.pageY = event.clientY + (document.documentElement.scrollTop || document.body.scrollTop); }
Works with no problems in IE7, Firefox 2 and Opera 8.5.
Change History (7)
comment:1 Changed 16 years ago by
comment:3 Changed 16 years ago by
If I had a dollar for everytime I have written this function.... I think this should be added to 1.1
Note: See
TracTickets for help on using
tickets.
Is there any browser apart from IE that doesn't provide pageX natively?
I'd rewrite the code a little: