- Added a hook to swap display none for width and height in browsers that do not sufficiently support get/setAttribute
This commit is contained in:
parent
1e9b3ef3d8
commit
5fc2281fcc
3 changed files with 24 additions and 5 deletions
|
@ -446,6 +446,20 @@ if ( !jQuery.support.getSetAttribute ) {
|
|||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
// Retrieving the width/height attributes on an
|
||||
// element with display: none returns 0 in ie6/7 (#5413)
|
||||
jQuery.each([ "width", "height" ], function( i, name ) {
|
||||
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
||||
get: function( elem ) {
|
||||
var ret;
|
||||
jQuery.swap( elem, { visibility: "hidden", display: "block" }, function() {
|
||||
ret = elem.getAttribute( name );
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Remove certain attrs if set to false
|
||||
|
|
|
@ -549,7 +549,8 @@ jQuery.extend({
|
|||
|
||||
// Return the cloned set
|
||||
return clone;
|
||||
},
|
||||
},
|
||||
|
||||
clean: function( elems, context, fragment, scripts ) {
|
||||
context = context || document;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue