Bug Tracker

Changeset 5613

Show
Ignore:
Timestamp:
05/15/08 20:29:52 (8 months ago)
Author:
brandon.aaron
Message:

Reverted back to using the num helper method in offset.js

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/offset.js

    r5612 r5613  
    113113 
    114114            // Subtract element margins 
    115             offset.top  -= parseInt( jQuery.curCSS( this[0], 'marginTop',  true ), 10 ) || 0; 
    116             offset.left -= parseInt( jQuery.curCSS( this[0], 'marginLeft', true ), 10 ) || 0; 
     115            // note: when an element has margin: auto the offsetLeft and marginLeft  
     116            // are the same in Safari causing offset.left to incorrectly be 0 
     117            offset.top  -= num( this, 'marginTop' ); 
     118            offset.left -= num( this, 'marginLeft' ); 
    117119 
    118120            // Add offsetParent borders 
    119             parentOffset.top  += parseInt( jQuery.curCSS( offsetParent[0], 'borderTopWidth',  true ), 10 ) || 0; 
    120             parentOffset.left += parseInt( jQuery.curCSS( offsetParent[0], 'borderLeftWidth', true ), 10 ) || 0; 
     121            parentOffset.top  += num( offsetParent, 'borderTopWidth' ); 
     122            parentOffset.left += num( offsetParent, 'borderLeftWidth' ); 
    121123 
    122124            // Subtract the two offsets