Scroll animate

Size
2,428 Kb
Views
34,408

How do I make an scroll animate?

What is a scroll animate? How do you make a scroll animate? This script and codes were developed by Revolution Graphics on 01 October 2022, Saturday.

Scroll animate Previews

Scroll animate - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Scroll animate</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Scroll animate - Script Codes CSS Codes

/*********************
Box Sizing
*********************/
*, *:before, *:after { box-sizing: inherit;
}
/*********************
General
*********************/
html { box-sizing: border-box; background: #1d1f20; height: 2000px;
}
body { position: relative;
}
div { position: fixed; display: inline-block; top: 0; width: 50px; height: 50px; background: green;
}

Scroll animate - Script Codes JS Codes

 TweenLite.defaultEase = Back.easeOut; TweenMax.set("div", {transformOrigin:"100% 0%", xPercent:-100, left:"100%", top:0});
var headerAnim = new TimelineLite({paused:true});
headerAnim.to("div", 1, {left:"50%"});
var scrollTimeout, scrollactive = false;
$(window).on('scroll', onscroll);
function onscroll(e) { console.log("onscroll"); if (!scrollactive) { scrollupdate(); // throttle the next scrollupdate scrollactive = true; clearTimeout(scrollTimeout); scrollTimeout = setTimeout(function() { scrollactive = false; }, 200); }
}
function scrollupdate() { console.log("scrollupdate"); $(window).scroll(function() { console.log("onscroll"); var scroll = $(window).scrollTop(); if (scroll >= 50) { headerAnim.play() } else { headerAnim.reverse() } });
}
Scroll animate - Script Codes
Scroll animate - Script Codes
Home Page Home
Developer Revolution Graphics
Username rgfx
Uploaded October 01, 2022
Rating 3
Size 2,428 Kb
Views 34,408
Do you need developer help for Scroll animate?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Revolution Graphics (rgfx) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!