Press "Enter" to skip to content

Easy To Use For Adding CSS Animation To Scrolling Elements | Scrollrisen

Scrollrisen is to trigger the css scrolling animation while items enter the viewport. Zero dependencies, lightweight, easy to use, and customizable.

AOS (Animate On Scroll) JavaScript library that plays, flips or zooms in CSS3-enabled animations on objects while scrolling to view.

NOTE You can extend or create custom list of animations if this isn’t enough for your use case by either modifying scrollrisen.css or adding styles to your custom css file.

scroll triggered animations, animate on scroll, animate content on scroll, animate div on scroll jquery, wow animation on scroll up and down, aos animation codepen

List of possible animations

Fade

data-srdescription
fadesimple fade animation
fade-lfade from left
fade-rfade from right
fade-tfade from top
fade-bfade from bottom
fade-t-lfade from top left
fade-t-rfade from top right
fade-b-lfade from bottom left
fade-b-lfade from bottom left
fade-b-rfade from bottom right

Flip

data-srdescription
flip-lflip from left
flip-rflip from right
flip-tflip from top
flip-bflip from bottom

Zoom

data-srdescription
zoomcenter zoom
zoom-lzoom from left
zoom-rzoom from right
zoom-tzoom from top
zoom-bzoom from bottom

How to make use of it:

1. Install and import the Scrollrisen.

# Yarn
$ yarn add scroll-risen

# NPM
$ npm i scroll-risen
import scrollrisen from 'scroll-risen/dist/scrollrisen.js'
import 'scroll-risen/dist/scrollrisen.css'

2. Or straight import the next information into the doc.

<link rel="stylesheet" href="dist/css/scrollrisen.css" />
<script src="dist/js/scrollrisen.js"></script>

3. Initialize the Scrollrisen and we’re able to go.

scrollrisen.init({
  // options here
});

4. Apply an animation to your factor utilizing the data-sr attribute.

<div class="box" data-sr="fade-l">Fade</div>
<div class="box" data-sr="flip-r">Flip</div>
<div class="box" data-sr="zoom">Zoom</div>

5. Default configurations.

scrollrisen.init({
  /**
   * easing function
   */
  easing: 'ease',
  /**
   * animation duration in ms
   */
  duration: 2000,
  /**
   * animation trigger point(where is the top of the element relative to viewport), 0,5 means center
   */
  trigger: 0.2,
  /**
   * should animation go in reverse when element is below the viewport
   */
  reverse: true,
  /**
   * how often should scroll handler be called in ms
   */
  debounce: 16,
  /**
   * active class applied to elements in viewport
   */
  activeClass: '_sr-active'
});

Trigger Fade/Flip/Zoom Animations On Scroll, Scrollrisen Plugin/Github, animate on scroll not working, css animations on scroll slide in from left


See Demo And Download

Official Website(bojan30): Click Here

This superior jQuery/javascript plugin is developed by bojan30. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.