I have set up a custom navigation bar which when I am scrolling through a website slides the current nav
which is occupying the majority of the screen out slightly.
Example extracts from the CSS and JS are as follows
/*CSS*/
#topnav {
top: 100px;
background-color:white;
border-top-style:solid;
}
.topActive {
z-index:5000;
width:3cm;
background-color:black;
border-style:solid;
border-right-style:none;
color:white;
}
/*JS*/
if(nav == 0) {
$("#topnav").addClass("topActive topnavb");
...
In this example, I would expect that when the nav tab in the nav bar slides out the background colour of it is black; however, in this case, the background colour would be white still. Essentially the class
is not overriding the properties in the id
I would appreciate any help in fixing this problem