Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Top Nav Menu items different colors

  Asked By: Sampat    Date: Jan 02    Category: Sharepoint    Views: 5623

Is there any way to have the top nav menu buttons to be different
My client wants to color code their portal sections..
I know that the top nav menu is one control and this may be difficult.



2 Answers Found

Answer #1    Answered By: Irving Hurley     Answered On: Jan 02

The current control  isn't set up to allow that. You would have to write
your own custom control. The question is, what metadata would you key
off of for the colors? Since the NavBar is dynamic you would have to
build in some algorithm for determining which color  to make the tab.

Answer #2    Answered By: Trevor Davis     Answered On: Jan 02

There doesn't appear to be an ID for each tab, but if you want to use a
little client-side JavaScript to manipulate the tabs, the following
example will change the background color  of a Team Site top-link bar tab
red with white text:

<script type="text/javascript">
var topNav = document.getElementById("onetIdTopNavBarContainer");
var links = topNav.getElementsByTagName("A");

for (var i=0; i < links.length; i++)
var link = links[i];
if (link.parentNode.nodeName == "TD")
if (link.innerText == "Child Site")
link.style.cssText = "background-image: none; background-color:
red; color: white;";

Didn't find what you were looking for? Find more on Top Nav Menu items different colors Or get search suggestion and latest updates.