Search code examples
javascriptjqueryanimationwebeasing

jQuery not working when adding ease property


I'm currently working on jQuery for animations in my website but the easing property is not working.

Here's the code:

$(window).load(function()
{
    $('div').animate({'height': '10px'}, 2000, 'easeInOutQuad');
}
);

Unfortunaltly, for some reason, it seems that jQuery doesn't recognize the ease property of .animate(), showing me a lot of errors, but only when I put ease property! Do I need to install something special? I only refers to jQuery 1.11.2.

Please help.


Solution

  • From the jQuery documentation:

    The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear.

    jQuery animate

    The easing you want to use is simply not implemented in the jQuery library. Additional easing options can be added with plugins (for example jQuery UI)