Commit e317bb71 authored by Brandon Aaron's avatar Brandon Aaron

offset now uses clientLeft and clientTop instead of calculating html border in IE

parent f576ceee
...@@ -23,13 +23,12 @@ jQuery.fn.offset = function() { ...@@ -23,13 +23,12 @@ jQuery.fn.offset = function() {
); );
// IE adds the HTML element's border, by default it is medium which is 2px // IE adds the HTML element's border, by default it is medium which is 2px
// IE 6 and IE 7 quirks mode the border width is overwritable by the following css html { border: 0; } // IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
// IE 7 standards mode, the border is always 2px // IE 7 standards mode, the border is always 2px
if ( msie ) { // This border/offset is typically represented by the clientLeft and clientTop properties
var border = jQuery("html").css("borderWidth"); // However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
border = (border == "medium" || jQuery.boxModel && parseInt(version) >= 7) && 2 || border; // Therefore this method will be off by 2px in IE while in quirksmode
add( -border, -border ); add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
}
// Otherwise loop through the offsetParents and parentNodes // Otherwise loop through the offsetParents and parentNodes
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment