I’m trying to add the countUp.js library to my project.
Everything works fine so far by following the sage 9 documentation on how to add 3rd party packages.
- Get the package
yarn add countUp.js
- Add it to main.js
import 'countup.js/countUp-jquery.js';
- Execute it like in the description
However, for this project I need to implement the jQuery support: https://github.com/inorganik/countUp.js/blob/master/countUp-jquery.js
Unfortunately I can’t make it work. I tried to import both, countUp.js
and countUp-jquery.js
to main.js and call the function in Common.js e.g. $('.test').countUp(4927.3);
but without luck.
Any hints on how to make it work?