ScrollReveal
Animate elements as they scroll into view.
README
Animate elements as they scroll into view.
Introduction
Installation
Browser
- ``` html
- <script src="https://unpkg.com/scrollreveal"></script>
- ```
Be careful using this method in production. Without specifying a fixed version number, Unpkg may delay your page load while it resolves the latest version. Learn more at unpkg.com
Module
- ``` sh
- npm install scrollreveal
- ```
CommonJS
- ``` js
- const ScrollReveal = require('scrollreveal')
- ```
ES2015
- ``` js
- import ScrollReveal from 'scrollreveal'
- ```
Usage
ScrollReveal employs the singleton pattern; no matter how many times the constructor is called, it will always return the same instance. This means we can call it anywhere, worry-free.
- ``` html
- <h1 class="headline">
- Widget Inc.
- </h1>
- ```
- ``` js
- ScrollReveal().reveal('.headline')
- ```
The full documentation can be found at https://scrollrevealjs.org
If you’re using an older version of ScrollReveal, you can find legacy documentation in the wiki