X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Foffset.js;h=c472f98520a65c578870dd8fb6101588730dc912;hb=d5d4e4df65b56319b4f1216f63008a9751690315;hp=c38a7f2163e1c55733731478f9c61026f46bcff5;hpb=bca576550249e9b79b1097669dff6d4ddd0d65cf;p=jquery.git diff --git a/src/offset.js b/src/offset.js index c38a7f2..c472f98 100644 --- a/src/offset.js +++ b/src/offset.js @@ -105,7 +105,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { jQuery.offset = { initialize: function() { - var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0, + var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0, html = "
"; jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); @@ -144,25 +144,25 @@ jQuery.offset = { jQuery.offset.initialize(); if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { - top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0; - left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0; + top += parseFloat( jQuery.css(body, "marginTop") ) || 0; + left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; } return { top: top, left: left }; }, setOffset: function( elem, options, i ) { - var position = jQuery.curCSS( elem, "position" ); + var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } - var curElem = jQuery( elem ), - curOffset = curElem.offset(), - curCSSTop = jQuery.curCSS( elem, "top", true ), - curCSSLeft = jQuery.curCSS( elem, "left", true ), + var curElem = jQuery( elem ), + curOffset = curElem.offset(), + curCSSTop = jQuery.css( elem, "top" ), + curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), props = {}, curPosition = {}, curTop, curLeft; @@ -212,12 +212,12 @@ jQuery.fn.extend({ // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0; - offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0; + offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; + offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; // Add offsetParent borders - parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0; - parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0; + parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; + parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; // Subtract the two offsets return {