Update $.fn.animate to change display mode only when necessary (inline, non-floated elements), and to use a more proper display mode for those elements. Fixes #2185.
This commit is contained in:
parent
0229b83f7e
commit
0cdcef5b36
6 changed files with 146 additions and 53 deletions
|
@ -66,6 +66,7 @@
|
|||
scriptEval: false,
|
||||
noCloneEvent: true,
|
||||
boxModel: null,
|
||||
inlineBlockNeedsLayout: false,
|
||||
reliableHiddenOffsets: true
|
||||
};
|
||||
|
||||
|
@ -119,6 +120,17 @@
|
|||
document.body.appendChild( div );
|
||||
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
|
||||
|
||||
// Check if natively block-level elements act like inline-block
|
||||
// elements when setting their display to 'inline'
|
||||
// (IE < 8 does this)
|
||||
if ( 'zoom' in div.style ) {
|
||||
div.style.display = 'inline';
|
||||
|
||||
// Layout is necessary to trigger this “feature”
|
||||
div.style.zoom = 1;
|
||||
jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
|
||||
}
|
||||
|
||||
// Check if table cells still have offsetWidth/Height when they are set
|
||||
// to display:none and there are still other visible table cells in a
|
||||
// table row; if so, offsetWidth/Height are not reliable for use when
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue