Handling JavaScript Event Listeners With Parameters — Smashing Magazine

Handling JavaScript Event Listeners With Parameters — Smashing Magazine

Event listeners are essential for interactivity in JavaScript, but they can quietly cause memory leaks if not removed properly. And what if your event listener needs parameters? That’s where things get interesting. Amejimaobari Ollornwi shares which JavaScript features make handling parameters with event handlers both possible and well-supported. JavaScript event listeners are very important, as…

Read More
Creating The “Moving Highlight” Navigation Bar With JavaScript And CSS — Smashing Magazine

Creating The “Moving Highlight” Navigation Bar With JavaScript And CSS — Smashing Magazine

In this tutorial, Blake Lundquist walks us through two methods of creating the “moving-highlight” navigation pattern using only plain JavaScript and CSS. The first technique uses the getBoundingClientRect method to explicitly animate the border between navigation bar items when they are clicked. The second approach achieves the same functionality using the new View Transition API….

Read More