Skip to content

yanick1/on-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

on-scroll

Simple wrapper for the Intersection Observer API

import { OnScroll } from "./on-scroll";

const fadeIn = new OnScroll(".fade-in", { classToggle: "visible", })

options

{number} threshold - 0 to 1 - how much the element is visible on screen (default 0.1) View documentation

{string} rootMargin - margin (default '0px') View documentation

{string} classToggle - class to toggle once it's visible

{function} callback - callback function, called with IntersectionObserverEntry, IntersectionObserver 

{boolean} repeatAnimation - Set to true to repeat the animation once the element is back on screen (default false)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors