Search code examples
jqueryjquery-animateeasingjquery-easing

jQuery Custom Easing Plugin with .animate


I'm using a jQuery plugin for custom Easing (jQuery Easing v1.3 -http://gsgd.co.uk/sandbox/jquery/easing/) to add custom easing to my jQuery Tools scrollable instances like so:

$(".historyScrollable").scrollable({ easing:"easeInOutCubic"}).navigator();

I was hoping to also use the jQuery Easing plugin to use with .animate functions

I've tried using it like this:

$(this).find('div').stop().animate({'marginLeft':'-280px'},200,easeInOutCubic);

but it says "easeInOutCubic" is not defined. Is what I'm doing possible, and I've just got the syntax wrong? I tried using specialEasing as well, but didn't seem to work either:

$(this).find('div').stop().animate({'marginLeft':'-280px'},{duration:200, customEasing:{'marginLeft':'easeInOutCubic'}});


Solution

  • .animate({'marginLeft':'-280px'},200,"easeInOutCubic");
    

    Use quotation marks!