Hi Barons,
The first thing we need to figure out is why the content is hidden in the first place. This hover show/hide is controlled by the style.css file.
This makes all of the content hidden:
Code:
#contentBox ul ul {
position:absolute; left:0px;
display:none;
z-index:100;
}
It is the display:none that hides the content.
If you simply remove this code, all of the content will show and overlap, and this is not what you want.
For what it is you're trying to do, I'm not able to think of an easy way of doing it using css. For this task, I would use javascript.
The first thing I would do is comment out the section of css that shows the content when you mouse over it:
Code:
/*
#contentBox ul li:hover ul {
display:block; top:-1px; top:19px;
}
*/
Everytime you mouse over one of the links, we need to call a javascript function. I'll include the code for the "home" link below, and you would do the same thing for all of the other links as well:
change:
Code:
<div class="titleCell">
<strong>Home</strong>
</div>
<ul>
to
Code:
<div class="titleCell" onMouseOver="toggle_menu('home');">
<strong>Home</strong>
</div>
<ul name="home" id="home">
We then need to create a hidden variable on the page to keep track of the last content shown. We need to know the last content so we know what to hide:
Code:
<input type="hidden" name="last_shown" id="last_shown" value="" />
We then need to create the toggle_menu function:
Code:
<script type="text/javascript">
function toggle_menu(menu_item) {
// grab the last content that is shown
last_content = document.getElementById('last_shown');
// hide the last item shown
if(last_content.value)
{
document.getElementById(last_content.value).style.display = "none";
}
// show the current item
document.getElementById(menu_item).style.display = "inline";
// set the current item now as the last item
last_content.value = menu_item;
}
</script>
That should give you the basics. You can view it in action here (and view the source code):
http://blog.bradmarkle.com/testing/tdb/
I hope that helps. Let me know if you have any questions.
Thanks,
- Brad