Changeset 5275
- Timestamp:
- 04/21/08 22:54:46 (9 months ago)
- Files:
-
- 1 modified
-
trunk/jquery/src/offset.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/offset.js
r4997 r5275 11 11 doc = elem.ownerDocument, 12 12 safari2 = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent), 13 fixed = jQuery.css(elem, "position") == "fixed"; 13 css = jQuery.curCSS, 14 fixed = css(elem, "position") == "fixed"; 14 15 15 16 // Use getBoundingClientRect if available … … 46 47 47 48 // Add the document scroll offsets if position is fixed on any offsetParent 48 if ( !fixed && jQuery.css(offsetParent, "position") == "fixed" )49 if ( !fixed && css(offsetParent, "position") == "fixed" ) 49 50 fixed = true; 50 51 … … 58 59 while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) { 59 60 // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug 60 if ( !/^inline|table.*$/i.test( jQuery.css(parent, "display")) )61 if ( !/^inline|table.*$/i.test(css(parent, "display")) ) 61 62 // Subtract parent scroll offsets 62 63 add( -parent.scrollLeft, -parent.scrollTop ); 63 64 64 65 // Mozilla does not add the border for a parent that has overflow != visible 65 if ( mozilla && jQuery.css(parent, "overflow") != "visible" )66 if ( mozilla && css(parent, "overflow") != "visible" ) 66 67 border( parent ); 67 68 … … 72 73 // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild 73 74 // Mozilla doubles body offsets with a non-absolutely positioned offsetChild 74 if ( (safari2 && (fixed || jQuery.css(offsetChild, "position") == "absolute")) ||75 (mozilla && jQuery.css(offsetChild, "position") != "absolute") )75 if ( (safari2 && (fixed || css(offsetChild, "position") == "absolute")) || 76 (mozilla && css(offsetChild, "position") != "absolute") ) 76 77 add( -doc.body.offsetLeft, -doc.body.offsetTop ); 77 78
