I don\'t know how to use JQuery, so I need a method which could trigger an animation using JavaScript only.
I need to call/trigger CSS Animation when the user scrol
Adding and removing the animation class does not work in a function. The delay is simply to little. As suggested by this article you can request the browser to reflow and then add the class. The delay isn't an issue in that case. Hence, you can use this code:
element.classList.remove("animation")
element.ofsettWidth
element.classList.add("animation")
The best thing is, this works everywhere. All credit goes to the article.