I'm trying to consume a couple of easing functions from jQuery UI without having to load the UI library completely.
Reference Source: jQuery easing functions without using a plugin
$.extend($.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert($.easing.default);
return $.easing[$.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
}
});
$(function(){
(function(){
$('#the_ribbon').animate({
top: '+=140',
}, 1000, function() {
//Consume an easing function here.
});
})();
});
In particular I would like to be able to consume a bounce like effect, not sure that will be easing (without having to include UI files).
How do I go about referencing and consuming these from the UI source?