Skip to content

Instantly share code, notes, and snippets.

@matharchod
Created October 19, 2011 23:16
Show Gist options
  • Save matharchod/1299969 to your computer and use it in GitHub Desktop.
Save matharchod/1299969 to your computer and use it in GitHub Desktop.
A custom jQuery easing function called "comicSwing". I use it on my portfolio site for my jQuery scrollables.
// custom easing called "comicSwing"
$.easing.comicSwing = function (x, t, b, c, d) {
var s = 1.5;
if ((t/=d/2) < 1) return c/5*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment