]> source.dussan.org Git - jquery.git/commitdiff
Fix for #1322
authorBrandon Aaron <brandon.aaron@gmail.com>
Fri, 29 Jun 2007 22:20:02 +0000 (22:20 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Fri, 29 Jun 2007 22:20:02 +0000 (22:20 +0000)
src/event/event.js

index bea2cbac7c6a093b9705b60464e50f894870f07e..52416e0fad67a14aa94b8b1d3a63632c0484d28a 100644 (file)
@@ -226,9 +226,9 @@ jQuery.event = {
 
                // Calculate pageX/Y if missing and clientX/Y available
                if ( event.pageX == null && event.clientX != null ) {
-                       var e = document.documentElement || document.body;
-                       event.pageX = event.clientX + e.scrollLeft;
-                       event.pageY = event.clientY + e.scrollTop;
+                       var e = document.documentElement, b = document.body;
+                       event.pageX = event.clientX + (e && e.scrollLeft || b && b.scrollLeft);
+                       event.pageY = event.clientY + (e && e.scrollTop || b && b.scrollTop);
                }
                        
                // Add which for key events