Need to build smooth and attractive fading techniques into your web site using nothing more than script? This article will explain a proven cross-browser method, with ready-to-use code. If you think you don’t need this, you will conclude otherwise after reading the article!
You’ll notice that each item is a link. This is to allow for browsers incapable of handling the DHTML, perhaps on a PDA. This way, they still have the option of navigating to the default page for each section, which should provide hard links to where they want to go. You also see the call to the swapNav( # ) function for each onMouseOver event, but before we get into that, let’s build our sub-level navigation.
So, all of our items are in place, but before we jump into the code, we must first set the CSS styles. You can define whatever styles you need to; just make sure you include the following:
Firstly, this tells each of our sub-level items to not display, because we’ve defined class="subNav" for each of them. Secondly, it defines the initial opacity of the whole block, which is essential to our modifying it. Unlike many styles, you can not modify the opacity filter on an object unless it has a defined initial value.
NOTE You also have to set the height property, otherwise the script refuses to work in IE for some reason.