I’m building a navigation system using jquery scrollto. I have my navigation menu in a separate file (( navigation.php )). It is included in 5 locations on the first page (( 5 different sections w/ text following each )). I’m trying to figure out a way to have the current “tab” highlight’d. I could hard code the navigation in each location to ensure it shows up the correct way, but I’d rather use the phpinclude() method. The other issue is that each “tab” has it’s own unique color (( cmykd )). Here is the alpha version of what I’m doing (( when you click && the page slides, the “active tab” still stays grey — I’d like it to be the corresponding color )).
Hope this all makes sense && thanks in advance !!
Few things first.
You have the same
<ul>in multiple places, each with the sameid. Same with the multiple<li>elements sharing IDs. This is not only invalid HTML but just a bad practice in general.Secondly, your document outline is backwards. Your text is in
<h2>elements whereas your navigation/headers are in<h3>elements. This is also invalid and a bad practice.Next, let’s talk about rest of the HTML for your navigation bars (which are doubling as section headers) and their content sections. Let’s look at new HTML for two of them (Creativity and Minimalism)
The key takeaways here are
Next, the CSS changes
Key takeaways here are
And finally, the modification to your jQuery
Key takeaways here are