( elem, properties, options )
| 6690 | } |
| 6691 | |
| 6692 | function Animation( elem, properties, options ) { |
| 6693 | var result, |
| 6694 | stopped, |
| 6695 | index = 0, |
| 6696 | length = Animation.prefilters.length, |
| 6697 | deferred = jQuery.Deferred().always( function() { |
| 6698 | |
| 6699 | // Don't match elem in the :animated selector |
| 6700 | delete tick.elem; |
| 6701 | } ), |
| 6702 | tick = function() { |
| 6703 | if ( stopped ) { |
| 6704 | return false; |
| 6705 | } |
| 6706 | var currentTime = fxNow || createFxNow(), |
| 6707 | remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), |
| 6708 | |
| 6709 | // Support: Android 2.3 |
| 6710 | // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) |
| 6711 | temp = remaining / animation.duration || 0, |
| 6712 | percent = 1 - temp, |
| 6713 | index = 0, |
| 6714 | length = animation.tweens.length; |
| 6715 | |
| 6716 | for ( ; index < length ; index++ ) { |
| 6717 | animation.tweens[ index ].run( percent ); |
| 6718 | } |
| 6719 | |
| 6720 | deferred.notifyWith( elem, [ animation, percent, remaining ] ); |
| 6721 | |
| 6722 | if ( percent < 1 && length ) { |
| 6723 | return remaining; |
| 6724 | } else { |
| 6725 | deferred.resolveWith( elem, [ animation ] ); |
| 6726 | return false; |
| 6727 | } |
| 6728 | }, |
| 6729 | animation = deferred.promise( { |
| 6730 | elem: elem, |
| 6731 | props: jQuery.extend( {}, properties ), |
| 6732 | opts: jQuery.extend( true, { |
| 6733 | specialEasing: {}, |
| 6734 | easing: jQuery.easing._default |
| 6735 | }, options ), |
| 6736 | originalProperties: properties, |
| 6737 | originalOptions: options, |
| 6738 | startTime: fxNow || createFxNow(), |
| 6739 | duration: options.duration, |
| 6740 | tweens: [], |
| 6741 | createTween: function( prop, end ) { |
| 6742 | var tween = jQuery.Tween( elem, animation.opts, prop, end, |
| 6743 | animation.opts.specialEasing[ prop ] || animation.opts.easing ); |
| 6744 | animation.tweens.push( tween ); |
| 6745 | return tween; |
| 6746 | }, |
| 6747 | stop: function( gotoEnd ) { |
| 6748 | var index = 0, |
| 6749 |
no test coverage detected