Skip to content

Instantly share code, notes, and snippets.

@louisremi
Created March 30, 2011 16:36
Show Gist options
  • Save louisremi/894754 to your computer and use it in GitHub Desktop.
Save louisremi/894754 to your computer and use it in GitHub Desktop.
prototype of cubic-bezier easings for jQuery
// example of use $(elem).animate( {top: 100}, $.cubicBezierEasing(.25,.1,.25,1) );
(function($) {
$.cubicBezierEasing = function(p0,p1,p2,p3,duration) {
var easingName = Array.prototype.join.call(arguments);
duration = duration || 1;
if ( !$.easing[easingName] ) {
$.easing[easingName] = function(pos) {
return cubicBezierAtTime.apply(null, Array.prototype.unshift.call(arguments, pos));
}
}
return easingName;
}
function cubicBezierAtTime() {
...
}
})(jQuery);
@rdallasgray
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment