var left = 0, top = 0, elem = this[0], results;
if ( elem ) with ( jQuery.browser ) {
- var absolute = jQuery.css(elem, "position") == "absolute",
- parent = elem.parentNode,
- offsetParent = elem.offsetParent,
- doc = elem.ownerDocument,
- safari2 = safari && !absolute && parseInt(version) < 522;
+ var absolute = jQuery.css(elem, "position") == "absolute",
+ parent = elem.parentNode,
+ offsetParent = elem.offsetParent,
+ doc = elem.ownerDocument,
+ safari2 = safari && parseInt(version) < 522;
// Use getBoundingClientRect if available
if ( elem.getBoundingClientRect ) {
- box = elem.getBoundingClientRect();
+ var box = elem.getBoundingClientRect();
// Add the document scroll offsets
add(
// Mozilla and Safari > 2 does not include the border on offset parents
// However Mozilla adds the border for table cells
- if ( mozilla && /^t[d|h]$/i.test(parent.tagName) || !safari2 )
+ if ( mozilla && !/^t[d|h]$/i.test(offsetParent.tagName) || safari && parseInt(version) >= 522 )
border( offsetParent );
// Safari <= 2 doubles body offsets with an absolutely positioned element or parent