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