Toggle CSS Class On Scroll – ClassToggler

Category: Javascript | May 22, 2019
Views Total:508 views
Official Page:Go to website
Last Update:May 22, 2019


Toggle CSS Class On Scroll – ClassToggler


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

You Might Be Interested In:

Leave a Reply