From a5f95c88c1c58565f0707e6c21bdf1874938a9d3 Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Sat, 6 Oct 2007 21:00:37 +0000 Subject: [PATCH] Fix normalization of pageX and pageY event properties in IE (#1571). Thanks wizzud. --- src/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5