It offers a range of options to activate, delay, and adjust animations to your liking, transforming static elements into an engaging, interactive experience.
1. Install & download.
# Yarn $ yarn add js-scroll-animations # NPM $ npm i js-scroll-animations
2. Import the JS Scroll Animations.
// As ES Module import jsScroll from "js-scroll-animations"; import "js-scroll-animations/styles.css";
<!-- Browser --> <link rel="stylesheet" href="dist/styles.css" /> <script src="dist/index.js"></script>
3. Add the data-jsscroll attribute to the element to be animated on scroll and choose an animation type of your choice as displayed below:
<div data-jsscroll data-jsscroll-fade-in > Fade In </div> <div data-jsscroll data-jsscroll-slide-top > Slide Top </div> <div data-jsscroll data-jsscroll-slide-bottom > Slide Bottom </div> <div data-jsscroll data-jsscroll-slide-left > Slide Left </div> <div data-jsscroll data-jsscroll-slide-right > Slide Right </div>
4. Config the scroll animation using the following data attributes:
<div data-jsscroll data-jsscroll-fade-in data-jsscroll-delay="0" data-jsscroll-threshold="1.25" >
5. API methods.
// initialize const jsScroll = jsScrollAnimations(); jsScroll.init(); // disable jsScroll.disable(); // reset jsScroll.reset(); // pause jsScroll.pause();
v0.9.3 (06/08/2025)
The post Fade/Slide In Elements On Scroll – JS Scroll Animations appeared first on CSS Script.
Ryan Coogler's The X-Files reboot has reportedly added Steve Buscemi, Amy Madigan, Ben Foster, and…
Wolfbox's "Megaflow" series of electric air dusters offer great build quality and powerful airflow at…
The wall mount you choose is going to be supporting your expensive TV for years,…
Wolfbox's "Megaflow" series of electric air dusters offer great build quality and powerful airflow at…
The wall mount you choose is going to be supporting your expensive TV for years,…
The third season of The Lord of the Rings: The Rings of Power will premiere…
This website uses cookies.