I have the following HTML in my ASP.net master page:
<div id="nav">
<ul class="glossymenu">
<li class="current"><a href=""><b>Home</b></a></l
i>
<li><a href=""><b>About Us</b></a></li>
<li><a href=""><b>Case Studies</b></a></li>
<li><a href=""><b>Contact</b></a>
</li>
</ul>
</div>
Its a css menu that I found on dynamicdrive.com. The css for this works great and produces a nice tabbed menu bar. the "current" class highlights the current page tab. However, because this is in the master page how would I change, for example the "About Us" listItem to have the "Current" style applied.
I dont have much experience with javascript so I tried this in my AboutUs.aspx page:
<script language="javascript" type="text/javascript">
function reWriteMenu(){
var myMenu = document.getElementById("n
av");
myMenu.innerHTML = "<ul class='glossymenu'><li><a href=''><b>Home</b></a></l
i><li class='current'><a href='about.aspx'><b>About
Us</b></a></li><li><a href=''><b>Case Studies</b></a></li><li><a
href=''><b>Contact</b></a>
</li></ul>
";
}
reWriteMenu();
</script>
This worked but it really defeats the object of putting it in the master page because i'd have to change it in every page if the menu changed. (i'd be re-writting the HTML on every page) Anyone got any suggestions??
Start Free Trial