hi. i want to animate a div element that is styled as a jquery dialog.
During the animation i need to adjust various widths and heights of the
border and background child-divs.. So i got a function to do that, and
it works.
I can call it after the animation has completed, but not during.
How would i hack that into the source of 1.2.6?
Here's the animate function, with my addition of inFlightCallback:
As it is now, it doesn't get called :(
animate: function( prop, speed, easing, callback, inFlightCallback ) {
var optall = jQuery.speed(speed, easing, callback);
return this[ optall.queue === false ? "each" : "queue" ](function(){
if ( this.nodeType != 1)
return false;
var opt = jQuery.extend({}, optall), p,
hidden = jQuery(this).is(":hidden"), self = this;
for ( p in prop ) {
if ( prop[p] == "hide" && hidden || prop[p] == "show" &&
!hidden )
return opt.complete.call(this);
if ( p == "height" || p == "width" ) {
// Store display property
opt.display = jQuery.css(this, "display");
// Make sure that nothing sneaks out
opt.overflow = this.style.overflow;
}
}
if (inFlightCallback) inFlightCallback();
if ( opt.overflow != null )
this.style.overflow = "hidden";
opt.curAnim = jQuery.extend({}, prop);
jQuery.each( prop, function(name, val){
var e = new jQuery.fx( self, opt, name );
if ( /toggle|show|hide/.test(val) )
e[ val == "toggle" ? hidden ? "show" : "hide" : val
]( prop );
else {
var parts =
val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
start = e.cur(true) || 0;
if ( parts ) {
var end = parseFloat(parts[2]),
unit = parts[3] || "px";
// We need to compute starting value
if ( unit != "px" ) {
self.style[ name ] = (end || 1) + unit;
start = ((end || 1) / e.cur(true)) * start;
self.style[ name ] = start + unit;
}
// If a +=/-= token was provided, we're doing a
relative animation
if ( parts[1] )
end = ((parts[1] == "-=" ? -1 : 1) * end) +
start;
e.custom( start, end, unit );
} else
e.custom( start, val, "" );
}
});
// For JS strict compliance
return true;
});
},