( elem, properties, options )
| 7536 | } |
| 7537 | |
| 7538 | function Animation( elem, properties, options ) { |
| 7539 | var result, |
| 7540 | stopped, |
| 7541 | index = 0, |
| 7542 | length = Animation.prefilters.length, |
| 7543 | deferred = jQuery.Deferred().always( function() { |
| 7544 | |
| 7545 | // Don't match elem in the :animated selector |
| 7546 | delete tick.elem; |
| 7547 | } ), |
| 7548 | tick = function() { |
| 7549 | if ( stopped ) { |
| 7550 | return false; |
| 7551 | } |
| 7552 | var currentTime = fxNow || createFxNow(), |
| 7553 | remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), |
| 7554 | |
| 7555 | // Support: Android 2.3 only |
| 7556 | // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) |
| 7557 | temp = remaining / animation.duration || 0, |
| 7558 | percent = 1 - temp, |
| 7559 | index = 0, |
| 7560 | length = animation.tweens.length; |
| 7561 | |
| 7562 | for ( ; index < length; index++ ) { |
| 7563 | animation.tweens[ index ].run( percent ); |
| 7564 | } |
| 7565 | |
| 7566 | deferred.notifyWith( elem, [ animation, percent, remaining ] ); |
| 7567 | |
| 7568 | // If there's more to do, yield |
| 7569 | if ( percent < 1 && length ) { |
| 7570 | return remaining; |
| 7571 | } |
| 7572 | |
| 7573 | // If this was an empty animation, synthesize a final progress notification |
| 7574 | if ( !length ) { |
| 7575 | deferred.notifyWith( elem, [ animation, 1, 0 ] ); |
| 7576 | } |
| 7577 | |
| 7578 | // Resolve the animation and report its conclusion |
| 7579 | deferred.resolveWith( elem, [ animation ] ); |
| 7580 | return false; |
| 7581 | }, |
| 7582 | animation = deferred.promise( { |
| 7583 | elem: elem, |
| 7584 | props: jQuery.extend( {}, properties ), |
| 7585 | opts: jQuery.extend( true, { |
| 7586 | specialEasing: {}, |
| 7587 | easing: jQuery.easing._default |
| 7588 | }, options ), |
| 7589 | originalProperties: properties, |
| 7590 | originalOptions: options, |
| 7591 | startTime: fxNow || createFxNow(), |
| 7592 | duration: options.duration, |
| 7593 | tweens: [], |
| 7594 | createTween: function( prop, end ) { |
| 7595 | var tween = jQuery.Tween( elem, animation.opts, prop, end, |
no test coverage detected