aboutsummaryrefslogtreecommitdiffstats
path: root/src/fx.js
diff options
context:
space:
mode:
authorJames Padolsey <jamespadolsey@gmail.com>2009-12-07 00:37:34 +0800
committerJohn Resig <jeresig@gmail.com>2009-12-07 16:11:46 +0800
commit93fdbeb963a9c350f807818c7cc99982942a92f3 (patch)
treedd782c485beda26b5de11ca967b6b3e9e14c7912 /src/fx.js
parent62a34450c0961e461a72ce4d96f94551ef393b56 (diff)
downloadjquery-93fdbeb963a9c350f807818c7cc99982942a92f3.tar.gz
jquery-93fdbeb963a9c350f807818c7cc99982942a92f3.zip
Added support for per-property easing
Diffstat (limited to 'src/fx.js')
-rw-r--r--src/fx.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fx.js b/src/fx.js
index 529fd4cde..6bcaac030 100644
--- a/src/fx.js
+++ b/src/fx.js
@@ -128,6 +128,11 @@ jQuery.fn.extend({
// Make sure that nothing sneaks out
opt.overflow = this.style.overflow;
}
+ if ( jQuery.isArray( prop[p] ) ) {
+ // Create (if needed) and add to specialEasing
+ (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+ prop[p] = prop[p][0];
+ }
}
if ( opt.overflow != null ) {
@@ -387,7 +392,9 @@ jQuery.fx.prototype = {
this.state = n / this.options.duration;
// Perform the easing function, defaults to swing
- this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+ var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+ var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+ this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
this.now = this.start + ((this.end - this.start) * this.pos);
// Perform the next step of the animation