Search code examples
javascriptjqueryjquery-uijquery-easing

Jquery easing doesnt work on font size?


I would like to know if any of you have experienced this and workarounds employed if they exist.

When i use animate normally on font-size it works perfectly. However, when i use easing equations along with the animate function i get the following error message :

Error: f.easing[e.animatedProperties[this.prop]] is not a function Source File: https://192.168.1.218/jquery.js Line: 18

The following is the js code i have used :

$(".myclass").animate({"font-size" : "16px"},"easeOutBounce",200);

Solution

  • First, as indicated in the documentation for animate(), you have to specify the easing argument after the duration, not before:

    $(".myclass").animate({
        "font-size": "16px"
    }, 200, "easeOutBounce");
    

    However, that alone won't solve your problem. The easeOutBounce effect is not part of the jQuery core, you'll have to include an additional plugin like jQuery Easing or the jQuery UI effects module to be able to use it.