Skip to content

instincthub/change-navbar-background-color-on-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Change Navbar Background Color On Scroll

Author: Noah Olatoye

This tutorial will target a navbar element on the page and change both background color and text color when the user scroll 100px from top of the page.

Functions Used:

  • The window.scroll Function to capture the scroll event whenever user scrolls.
  • The scrollNavbar function is used to declare what happen whenever user scrolls

What you will find in the scrollNavbar Function:

  • if statement to check the condition whether the user scrolls up to 100px
  • Changed the background color of the navbar upon scroll
  • forloop to add and remove color on links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published