Toggle CSS Class On Scroll – ClassToggler

Category: Javascript | May 22, 2019
Author: thesamplepg
Views Total: 122
Official Page: Go to website
Last Update: May 22, 2019
License: MIT

Preview:

Toggle CSS Class On Scroll – ClassToggler

Description:

A small JavaScript library that toggles CSS classes of an element when it is scrolled into or out of the viewport.

Can be used to animate elements when they come into view.

How to use it:

Import the ClassToggler into the page.

<script src="/path/to/classToggler.js"></script>

Defined the CSS class to toggle via the HTML data-toggler attribute.

<div data-toggler="animationClass">
  Element to animate on scroll
</div>

You Might Be Interested In:


Leave a Reply