AOS.init();
All you have to do is to add data-aos
attribute to html element, like so:
These settings can be set both on certain elements, or as default while initializing script (in options object without data- part).
Attribute | Description | Example value | Default value |
---|---|---|---|
data-aos-offset |
Change offset to trigger animations sooner or later (px) | 200 | 120 |
data-aos-duration |
*Duration of animation (ms) | 600 | 400 |
data-aos-easing |
Choose timing function to ease elements in different ways | ease-in-sine | ease |
data-aos-delay |
Delay animation (ms) | 300 | 0 |
data-aos-anchor |
Anchor element, whose offset will be counted to trigger animation instead of actual elements offset | #selector | null |
data-aos-anchor-placement |
Anchor placement - which one position of element on the screen should trigger animation | top-center | top-bottom |
data-aos-once |
Choose wheter animation should fire once, or every time you scroll up/down to element | true | false |
There are serveral predefined animations you can use already: