I am working on a website with a menu structured like the following:
Home -- Work -- Pricing -- Contact Us -- About
This website uses a one-page layout and has enabled Scrollspy on Bootstrap. I need to make the active menu background dynamic depending on which section is currently in focus. For example, when the user scrolls down to the "About" section, the background color of the corresponding menu item should change as shown in the image.
The current CSS code controlling this behavior is:
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
background-color: #080808;
color: #FFFFFF;
}