Back to all Elements

Simple Mega Nav (Similar to Mailchimp's)

A very simple mega navigation bar, opens on hover and changes background color on scroll.

Creating the Nav element is a short process recorded here.

Once we're done, we can add the short code, that changes the Nav background color when user has scrolled the page x pixels.

<script>

 $(window).on("scroll", function() {

   if ($(window).scrollTop() > 100) {

     $(".mega-nav").addClass("white");

   } else {

     $(".mega-nav").removeClass("white");

   }

 });

</script>

Copy

We can see that the code adds the '.white' classname to the '.mega-nav'. We need to create this class name in the Designer, or add it manually in code.

Adding it in code will make it less easy to edit / change. Adding it in the Designer without having an element with this this class results in the ability to delete the classname at the Style Manager's Clean-up:

Preview:

The videos Kurzgesagt channel creates are so beautifully animated, that I almost forget that I learn so much while watching them!

Might also interest you:

Thick Underline

Cloneable
Design
Tricks

An editable thick underline for your Headlines

Read more

ToDo List

Cloneable
Code

A todo list, created with JavaScript collected through the internet... ;)

Read more

Modal Lottie Transition

Cloneable
Design
Interactions

A full screen close/open animation with lottie

Read more