I recently received a zip file containing a template purchased from themeforest, with a request to make modifications. The template includes a horizontal navigation bar with links to various sections on the page. In the original template, when you click on a link, it changes the background color of the active navigation link depending on which section you are in. However, after modifying the page and using my version, this feature seems to be not working.
I've tried changing the class name from .active
to .viewing
in case there was a naming conflict, but it didn't resolve the issue. It appears that I might not be familiar with some scripts or bootstrap CSS used in the page.
The code for the navigation bar is as follows:
<div class="span9 nav-wrapper">
<nav>
<ul>
<li><a href="#section-home" id="nav-home" class="active">Home</a></li>
<li><a href="#our-team" id="nav-team">Team</a></li>
<li><a href="#our-services" id="nav-services">Services</a></li>
<li><a href="#contact-section" id="nav-contact">Contact</a></li>
</ul>
</nav>
<div class="header-phone-number"><span>Call us on</span> <i class="icon-phone"></i> 1800 25 1800</div>
</div>
The CSS styling applied to the links is given below:
nav a {
color: #fff;
text-transform: uppercase;
display: inline-block;
padding: 26px 20px;
font-size: 12px;
font-family: 'Open Sans',sans-serif;
}
nav a:hover {
background: #616a73;
}
nav a:hover,
nav a:visited {
color: #fff;
text-decoration: none;
outline: none;
}
nav a.active {
background: #4c5660 url(../img/banner-bg.jpg);
color: #fff;
outline: none;
}
I am seeking guidance on how the ".active" class functions within this specific navigation bar and how it applies to other links when clicked. Is it related to jQuery? Why does my modified page appear to be malfunctioning even though I only changed the colors of the navigation bar from the original template?
Your assistance would be greatly appreciated.