Hi.
I am having serious problems trying to get this to work.
I have a javascript drop down menu. When I click on the parent, a div with links is made visible. Now, I have put a div inside the div that pops up yet I can only get one to work.
I am using event handlers and a small js script.
Here's a a very small, rearranged script for clarity:
Code:
<a onclick="showdiv('div1');">Click Me</a>
<div id="div1>
<!--LINKS-->
<div id="div2"></div>
</div>
<script type="text/javascript">
function showdiv(id)
{
if(menudiv) menudiv.style.visibility = 'hidden';
menudiv = document.getElementById(id);
menudiv.style.visibility = 'visible';
}
</script>
I have tried to declare several 'ids' in the onclick event handler, like ('div1','div2') but that hasn't worked.
Is there a way to declare several ids like shown above or will I have to alter the js script?
Many thanks,
Damien.
|