I've used this method to highlight the location page that the user is on. Below is a working example of how this functions. This works in div tags or in a tables and cross browsers. Below I've created a main Navigation and two sub navigation. Terminal Intensity, Surreal 1, & Surreal 2 are in the main navigation and in this demonstration Terminal Intention will be the one effected by the Javascript. Terminal Intensity #4, Terminal Intensity #5, Terminal Intensity #6 are in the first subnavigation and Terminal Intensity #4 will be effected by the javascript. Default Page, Development and Close ups is the second subnavigation and Default Page will be the one effected by the Javascript.
I'm sure there are many methods out there that do the same thing. This is yet another one and I wanted to share it.
Put this CSS in your page.
<style type="text/css">
<!--
.LNTi { background-color: #200401; color: #E0B9B4; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 5px; height: 14px; width: 170px; }
a.LNTi:hover { background-color: #491B16; color: #E0B9B4; }
.TiLNhi { background-color: #491B16; color: #FFFFFF; text-transform: uppercase; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 16px; height: 14px; width: 170px; }
.TiSN2hi { background-color: #481B16; color: #FFFFFF; text-transform: uppercase; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 16px; height: 14px; width: 170px; }
.TiSN { background-color: #6F322B; color: #E0B9B4; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 5px; height: 14px; width: 118px; }
a.TiSN:hover { background-color: #CA8980; color: #FFFFFF; }
.SNTi { background-color: #6F322B; color: #E0B9B4; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 5px; height: 14px; width: 170px; }
a.SNTi:hover { background-color: #CA8980; color: #6F322B;}
.LNSurreal1 { background-color: #270600; color: #E5BAB4; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 5px; height: 14px; width: 170px; }
a.LNSurreal1:hover { background-color: #501C16; color: #E5BAB4; }
.LNSurreal2 { background-color: #200401; color: #E0B9B4; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 5px; height: 14px; width: 170px; }
a.LNSurreal2:hover { background-color: #491B16; color: #E0B9B4; }
-->
</style>
This javascript changes the CSS style based on the id that is in the a href. Take a look and you can see the match ups in the js and the corresponding ids in the a href(s). Also take a look at the js that notes the changing of the css style (classname=).
<script type="text/javascript">
<!--
function bodyload()
{
window.document.all("id_LMN_ti").className="TiLNhi";
window.document.all("id_p_ti4").className="TiLNhi";
window.document.all("id_p_ti4_default").className="TiSN2hi";
}
//-->
</script>
Put the onload in your body tag or this won't work!
<body onLoad="bodyload()">
Put these in separate table cells or in div tags.
(*note - main nav)
<a id="id_LMN_ti" href="terminal_intensity.html" class="LNTi" title="Terminal Intensity">Terminal Intensity</a>
<a id="id_LMN_surreal1" href="surreal_1.html" class="LNSurreal1" title="Surrealism 1">Surrealism 1</a>
<a id="id_LMN_surreal2" href="surreal_2.html" class="LNSurreal2" title="Surrealism 2">Surrealism 2</a>
(*note - sub nav 1)
<a id="id_p_ti4" href="terminal_intensity_4.html" class="SNTi" title="Terminal Intensity #4">Terminal Intensity #4</a>
<a id="id_p_ti5" href="terminal_intensity_5.html" class="SNTi" title="Terminal Intensity #5">Terminal Intensity #5</a>
<a id="id_p_ti6" href="terminal_intensity_6.html" class="SNTi" title="Terminal Intensity #6">Terminal Intensity #6</a>
(*note - sub nav 2)
<a id="id_p_ti4_default" href="terminal_intensity_4.html" class="TiSN" title="Terminal Intensity #4, Default Page">Default Page</a>
<a id="id_p_ti4_htitle" href="terminal_intensity_4_dev1.html" class="TiSN" title="Terminal Intensity #4, Development">Development</a>
<a id="id_p_ti4_cutitle" href="terminal_intensity_4_cu1.html" class="TiSN" title="Terminal Intensity #4, Close up">Close ups</a>