Fade on scroll
How do I make an fade on scroll?
What is a fade on scroll? How do you make a fade on scroll? This script and codes were developed by Miro Olma on 26 November 2022, Saturday.
Fade on scroll - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>fade on scroll</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="main"> <div class="header"> <h1> FADE ME OUT </h1> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Fade on scroll - Script Codes CSS Codes
.main { height: 1000px; width: 100%; background-color: magenta;
}
.header { width: 100%; height: 500px; background-color: yellow;
}
h1 { position: relative; top: 50%; transform: translateY(-50%); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
Fade on scroll - Script Codes JS Codes
var intro = $('.header');
var h1 = $('.header h1');
$(window).on('scroll', function() { var st = $(this).scrollTop(); intro.css({ 'opacity' : (1 - st/500) }); h1.css({'opacity' : (1 - st/500) });
});
Developer | Miro Olma |
Username | programiro |
Uploaded | November 26, 2022 |
Rating | 3 |
Size | 2,084 Kb |
Views | 6,072 |
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!
Name | Size |
Sticky Footer | 1,697 Kb |
Input autofill for Klickdummy on focus | 2,036 Kb |
Justify Navi | 1,819 Kb |
Video Preloader | 2,513 Kb |
A Pen by Miro Olma | 2,342 Kb |
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!
Name | Username | Size |
A Pen by Alexandru Pora | Axpro | 1,615 Kb |
DFF Website | Hawcubite | 10,123 Kb |
Atom | Bhlaird | 1,932 Kb |
Custom checkbox example | Capelo | 3,495 Kb |
IE flex collapse bug fix | Rowno | 2,678 Kb |
FreeCodeCamp - Simon Game | Ivhed | 8,481 Kb |
Angular Route | Arun_v606 | 1,837 Kb |
Google Fonts Sass Mixin | HugoGiraudel | 4,237 Kb |
Basic HTML5 Structure | YuvarajTana | 1,289 Kb |
Console fun | Dviate | 1,500 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!