mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 06:55:16 -05:00
Effects: set default easing using jQuery.easing._default
Fixes gh-2219 Close gh-2218
This commit is contained in:
5
src/effects.js
vendored
5
src/effects.js
vendored
@@ -289,7 +289,10 @@ function Animation( elem, properties, options ) {
|
||||
animation = deferred.promise({
|
||||
elem: elem,
|
||||
props: jQuery.extend( {}, properties ),
|
||||
opts: jQuery.extend( true, { specialEasing: {} }, options ),
|
||||
opts: jQuery.extend( true, {
|
||||
specialEasing: {},
|
||||
easing: jQuery.easing._default
|
||||
}, options ),
|
||||
originalProperties: properties,
|
||||
originalOptions: options,
|
||||
startTime: fxNow || createFxNow(),
|
||||
|
||||
@@ -13,7 +13,7 @@ Tween.prototype = {
|
||||
init: function( elem, options, prop, end, easing, unit ) {
|
||||
this.elem = elem;
|
||||
this.prop = prop;
|
||||
this.easing = easing || "swing";
|
||||
this.easing = easing || jQuery.easing._default;
|
||||
this.options = options;
|
||||
this.start = this.now = this.cur();
|
||||
this.end = end;
|
||||
@@ -105,7 +105,8 @@ jQuery.easing = {
|
||||
},
|
||||
swing: function( p ) {
|
||||
return 0.5 - Math.cos( p * Math.PI ) / 2;
|
||||
}
|
||||
},
|
||||
_default: "swing"
|
||||
};
|
||||
|
||||
jQuery.fx = Tween.prototype.init;
|
||||
|
||||
Reference in New Issue
Block a user