Skip to content

Getting Started (v3.x)

Julian Lloyd edited this page Aug 6, 2018 · 1 revision

Installation

The simplest method is to copy paste this snippet just before your closing </body> tag.

<script src="https://unpkg.com/scrollreveal/dist/scrollreveal.min.js"></script>

But you can also:

  • Download ZIP
  • npm install scrollreveal
  • bower install scrollreveal

The Basics

The reveal() method is the primary API, and makes it easy to create and manage various types of animations.

<!-- HTML -->
<div class="foo"> Foo </div>
<div class="bar"> Bar </div>
// JavaScript
window.sr = ScrollReveal();
sr.reveal('.foo');
sr.reveal('.bar');