ScrollMagic - FadeIn FadeOut
How do I make an scrollmagic - fadein fadeout?
What is a scrollmagic - fadein fadeout? How do you make a scrollmagic - fadein fadeout? This script and codes were developed by Kazu on 28 October 2022, Friday.
ScrollMagic - FadeIn FadeOut - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>ScrollMagic - FadeIn FadeOut</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <header role="banner"> <img src="//s3-us-west-2.amazonaws.com/s.cdpn.io/392/demo_tophat.png" width="64" height="auto" alt="scroll magic" />
</header>
<main class="full-screen" role="main"> <section class="full-screen blue"> <div> <h1>Fade In Fade Out</h1> </div> </section> <section id="fadein-trigger" class="red"> <div> <h1>Fadein Trigger</h1> <p>This text will fade in and fade out as you scroll...yo!</p> </div> </section> <section class="full-screen blue" id="fadeout-trigger"> <div> <h1>Fadeout Trigger</h1> </div> </section>
</main> <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.16.1/TweenMax.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.1/ScrollMagic.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.1/plugins/animation.gsap.js'></script> <script src="js/index.js"></script>
</body>
</html>
ScrollMagic - FadeIn FadeOut - Script Codes CSS Codes
/* Demo Styes: Not Required
*/
html,
body { margin: 0; height: 100%;
}
h1,
p { margin: 0; padding: 0;
}
header { position: fixed; top: 10px; left: 10px;
}
section,
section > div { display: flex; justify-content: center; align-items: center; text-align: center; color: #efefef;
}
.full-screen { height: 100%; /*makes panels the entire window height*/
}
.blue { background-color: #3883d8;
}
.red { background-color: #cf3535;
}
#fadein-trigger > div { height: 400px; opacity: 0;
}
ScrollMagic - FadeIn FadeOut - Script Codes JS Codes
var fadein_tween = TweenMax.to('#fadein-trigger > div', .375, { opacity: 1});
var fadeout_tween = TweenMax.to('#fadein-trigger > div', .375, { opacity: 0 });
var controller = new ScrollMagic.Controller();
var fadein_scene = new ScrollMagic.Scene({ triggerElement: '#fadein-trigger', reverse: true
})
.setTween(fadein_tween)
.addTo(controller);
var fadeout_scene = new ScrollMagic.Scene({ triggerElement: '#fadeout-trigger', reverse: true
})
.setTween(fadeout_tween)
.addTo(controller);
Developer | Kazu |
Username | carmerano |
Uploaded | October 28, 2022 |
Rating | 3 |
Size | 2,731 Kb |
Views | 80,960 |
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 |
Full screen layout 1-pizza | 1,947 Kb |
CSS Continuous Slide | 1,634 Kb |
A Pen by Kazu | 2,896 Kb |
Audio Wave Preloader | 1,707 Kb |
Flexbox | 1,688 Kb |
Horizontal Drop Down Menu | 7,820 Kb |
Hover Effect Test | 2,380 Kb |
Responsive Table | 3,674 Kb |
Responsive Menu Button | 1,850 Kb |
3D shading with box shadow | 4,620 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 |
Welcome | Nakome | 6,076 Kb |
Resume | Rottingroom | 5,483 Kb |
Bootstrap Responsive Menu Drawer | JesseGlacken | 3,777 Kb |
GrcJS | Vino6 | 2,047 Kb |
Loading animation | Hafizfattah | 0 Kb |
Lazy Load for Background Images | The_ruther4d | 2,977 Kb |
Automatic scroll | Skeurentjes | 4,042 Kb |
Wikipedia API | Coderpilot | 2,802 Kb |
Full page table inside the grid | Twikito | 1,864 Kb |
Touch Carousel - last, no gaps. | Berkin | 4,332 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!