From: Brandon Aaron Date: Sat, 6 Oct 2007 21:00:37 +0000 (+0000) Subject: Fix normalization of pageX and pageY event properties in IE (#1571). Thanks wizzud. X-Git-Tag: 1.2.2b~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a5f95c88c1c58565f0707e6c21bdf1874938a9d3;p=jquery.git Fix normalization of pageX and pageY event properties in IE (#1571). Thanks wizzud. --- diff --git a/src/event.js b/src/event.js index 657002842..070ed9eb3 100644 --- a/src/event.js +++ b/src/event.js @@ -267,8 +267,8 @@ jQuery.event = { // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0); + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientLeft || 0); } // Add which for key events