mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
parent
9261e7ee13
commit
044d47a504
53
src/fx/fx.js
53
src/fx/fx.js
@ -364,34 +364,6 @@ jQuery.fn.extend({
|
||||
|
||||
jQuery.extend({
|
||||
|
||||
setAuto: function(e,p) {
|
||||
if ( e.notAuto ) return;
|
||||
|
||||
if ( p == "height" && e.scrollHeight != parseInt(jQuery.curCSS(e,p)) ) return;
|
||||
if ( p == "width" && e.scrollWidth != parseInt(jQuery.curCSS(e,p)) ) return;
|
||||
|
||||
// Remember the original height
|
||||
var a = e.style[p];
|
||||
|
||||
// Figure out the size of the height right now
|
||||
var o = jQuery.curCSS(e,p,1);
|
||||
|
||||
if ( p == "height" && e.scrollHeight != o ||
|
||||
p == "width" && e.scrollWidth != o ) return;
|
||||
|
||||
// Set the height to auto
|
||||
e.style[p] = e.currentStyle ? "" : "auto";
|
||||
|
||||
// See what the size of "auto" is
|
||||
var n = jQuery.curCSS(e,p,1);
|
||||
|
||||
// Revert back to the original size
|
||||
if ( o != n && n != "auto" ) {
|
||||
e.style[p] = a;
|
||||
e.notAuto = true;
|
||||
}
|
||||
},
|
||||
|
||||
speed: function(s,o) {
|
||||
o = o || {};
|
||||
|
||||
@ -493,6 +465,8 @@ jQuery.extend({
|
||||
// Remember where we started, so that we can go back to it later
|
||||
z.el.orig[prop] = this.cur();
|
||||
|
||||
z.o.show = true;
|
||||
|
||||
// Begin the animation
|
||||
z.custom(0, z.el.orig[prop]);
|
||||
|
||||
@ -514,10 +488,6 @@ jQuery.extend({
|
||||
z.custom(z.el.orig[prop], 0);
|
||||
};
|
||||
|
||||
// Remember the overflow of the element
|
||||
if ( !z.el.oldOverflow )
|
||||
z.el.oldOverflow = jQuery.css( z.el, "overflow" );
|
||||
|
||||
// Make sure that nothing sneaks out
|
||||
y.overflow = "hidden";
|
||||
|
||||
@ -542,25 +512,22 @@ jQuery.extend({
|
||||
|
||||
if ( done ) {
|
||||
// Reset the overflow
|
||||
y.overflow = z.el.oldOverflow;
|
||||
y.overflow = '';
|
||||
|
||||
// Hide the element if the "hide" operation was done
|
||||
if ( z.o.hide )
|
||||
y.display = 'none';
|
||||
// Otherwise reset the display property
|
||||
else if ( z.o.show )
|
||||
y.display = '';
|
||||
|
||||
// Reset the property, if the item has been hidden
|
||||
if ( z.o.hide ) {
|
||||
for ( var p in z.el.curAnim ) {
|
||||
// Reset the properties, if the item has been hidden or shown
|
||||
if ( z.o.hide || z.o.show )
|
||||
for ( var p in z.el.curAnim )
|
||||
if (p == "opacity")
|
||||
jQuery.attr(y, p, z.el.orig[p]);
|
||||
else
|
||||
y[ p ] = z.el.orig[p] + "px";
|
||||
|
||||
// set its height and/or width to auto
|
||||
if ( p == 'height' || p == 'width' )
|
||||
jQuery.setAuto( z.el, p );
|
||||
}
|
||||
}
|
||||
y[p] = '';
|
||||
}
|
||||
|
||||
// If a callback was provided, execute it
|
||||
|
Loading…
Reference in New Issue
Block a user