Integrate external CSS animation libraries (e.g., Animate.css)
nextYou can use AOS to trigger external CSS animation libraries by configuring useClassNames, initClassName, and animatedClassName.
- Set
useClassNames: trueso that the content ofdata-aosis applied as a class. - Set
initClassName: falseto prevent the defaultaos-initclass. - Set
animatedClassNameto the class used by your library (e.g.,'animated').
Example Configuration
<div data-aos="fadeInUp"></div>AOS.init({
useClassNames: true,
initClassName: false,
animatedClassName: 'animated',
});Note: Since external libraries might not handle the 'pre-animation' state, you may need to manually hide elements before they animate:
[data-aos] {
visibility: hidden;
}
[data-aos].animated {
visibility: visible;
}