Fade Navbar and Images on Scroll (with the Intersection Observer JavaScript API)

Pubblicato il: 29 marzo 2022
sul canale di: Coding in Public
5,733
169

In this video, I'll show you how to use the Intersection Observer API in Javascript. With some simple vanilla Javascript, we’ll trigger a class on our nav to add a background color on scroll and create a fade-up animation on images and different elements on the page. The intersection observer is more performant because it doesn’t have to watch every moment you scroll. You tell it what to watch and it’ll observe (almost like a click event listener) and run only when the element enters or leaves the page.

🔗 Key Links 🔗
- GitHub: https://github.com/coding-in-public/r...
- Live Code: https://codinginpublic.dev/projects/r...
- MDN docs: https://developer.mozilla.org/en-US/d...
- Andy Bell’s CSS reset: https://piccalil.li/blog/a-modern-css...

---------------------------------------

📹 Related Videos 📹
- Responsive Navigation:    • Responsive Navbar HTML, CSS, and Java...  

---------------------------------------

⏲️ Timestamps ⏲️
0:00 Introduction
0:42 Understanding the Intersection Observer
2:30 Fade Navbar on scroll
10:28 Fade images on scroll
17:59 Respecting reduce motion

---------------------------------------

🌐 Connect With Me 🌐
- Website: https://codinginpublic.dev
- Blog: https://chrispennington.blog
- Twitter:   / cpenned  


In questa pagina del sito puoi guardare il video online Fade Navbar and Images on Scroll (with the Intersection Observer JavaScript API) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Coding in Public 29 marzo 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 5,733 volte e gli è piaciuto 169 spettatori. Buona visione!