( elem, properties, options )
| 7720 | } |
| 7721 | |
| 7722 | function Animation( elem, properties, options ) { |
| 7723 | var result, |
| 7724 | stopped, |
| 7725 | index = 0, |
| 7726 | length = Animation.prefilters.length, |
| 7727 | deferred = jQuery.Deferred().always( function() { |
| 7728 | |
| 7729 | // don't match elem in the :animated selector |
| 7730 | delete tick.elem; |
| 7731 | } ), |
| 7732 | tick = function() { |
| 7733 | if ( stopped ) { |
| 7734 | return false; |
| 7735 | } |
| 7736 | var currentTime = fxNow || createFxNow(), |
| 7737 | remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), |
| 7738 | |
| 7739 | // Support: Android 2.3 |
| 7740 | // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) |
| 7741 | temp = remaining / animation.duration || 0, |
| 7742 | percent = 1 - temp, |
| 7743 | index = 0, |
| 7744 | length = animation.tweens.length; |
| 7745 | |
| 7746 | for ( ; index < length ; index++ ) { |
| 7747 | animation.tweens[ index ].run( percent ); |
| 7748 | } |
| 7749 | |
| 7750 | deferred.notifyWith( elem, [ animation, percent, remaining ] ); |
| 7751 | |
| 7752 | if ( percent < 1 && length ) { |
| 7753 | return remaining; |
| 7754 | } else { |
| 7755 | deferred.resolveWith( elem, [ animation ] ); |
| 7756 | return false; |
| 7757 | } |
| 7758 | }, |
| 7759 | animation = deferred.promise( { |
| 7760 | elem: elem, |
| 7761 | props: jQuery.extend( {}, properties ), |
| 7762 | opts: jQuery.extend( true, { |
| 7763 | specialEasing: {}, |
| 7764 | easing: jQuery.easing._default |
| 7765 | }, options ), |
| 7766 | originalProperties: properties, |
| 7767 | originalOptions: options, |
| 7768 | startTime: fxNow || createFxNow(), |
| 7769 | duration: options.duration, |
| 7770 | tweens: [], |
| 7771 | createTween: function( prop, end ) { |
| 7772 | var tween = jQuery.Tween( elem, animation.opts, prop, end, |
| 7773 | animation.opts.specialEasing[ prop ] || animation.opts.easing ); |
| 7774 | animation.tweens.push( tween ); |
| 7775 | return tween; |
| 7776 | }, |
| 7777 | stop: function( gotoEnd ) { |
| 7778 | var index = 0, |
| 7779 |
no test coverage detected