GithubHelp home page GithubHelp logo

rakesh-mohanta / scrollreveal.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jlmakes/scrollreveal

0.0 2.0 0.0 2.64 MB

Easily reveal elements as they enter the viewport.

Home Page: http://scrollrevealjs.org/

License: Other

scrollreveal.js's Introduction

#scrollReveal.js scrollReveal version License

Easily reveal elements as they enter the viewport.

  • Developed for modern browsers
  • 3.2KB minified and Gzipped
  • An open-source project by Julian Lloyd


Installation

Please use which ever is most comfortable:

  • Download ZIP
  • git clone https://github.com/julianlloyd/scrollReveal.js.git
  • bower install scrollReveal.js

Once you’ve got scrollReveal.min.js into your project’s JavaScript directory, let’s instantiate it!

<!DOCTYPE html>
<html>
  <body>

    <!-- All your stuff up here... -->

    <script src='/js/scrollReveal.min.js'></script>
    <script>

      window.sr = new scrollReveal();

    </script>
  </body>
</html>

Basic Usage

How does it work? Just add data-sr to an element, and it will reveal as it enters the viewport.

<p data-sr> Chips Ahoy! </p>

Taking Control

You guessed it, the data-sr attribute is waiting for you to describe the type of animation you want. It’s as simple as using a few keywords and natural language.

<div data-sr="enter left please, and hustle 20px"> Foo </div>
<div data-sr="wait 2.5s and then ease-in-out 100px"> Bar </div>
<div data-sr="enter bottom and scale up 20% over 2s"> Baz </div>

What you enter into the data-sr attribute is parsed for specific words:

  • Keywords that expect to be followed by a value. (e.g. move 50px)
  • Sugar (optional) for fun and comprehension. (e.g. and, then, please, etc.)

Recommended Next: Keywords →

scrollreveal.js's People

Contributors

jlmakes avatar izifortune avatar

Watchers

Rakesh mohanta avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.