Simple appear on scroll CSS-based library
Simple Appear/Reveal on scroll library by changing element opacity. JS toggle classes on element depending on current scroll position.
- Add
aos.cssandaos.jsinto your html file. - Add class
appear-on-scrollto your desired element.
There are two attributes that can be modified in the js file: repeat and elementOffset.
repeat: the default value istrue. By changing this attribute to false, the appear animation will happen only once when the element is in scroll view.elementOffset: the amount of offset from the bottom of the screen to the top position of the element when it appears. The default value isvh / 6.