I'm making a vertical navigation menu using css and jquery to make the submenus hidden by default but clicking on a menu item expands it to show the submenus.
<div id="navmenu">
<ul id="menu">
<li><a href="welcome.html" target="content">Welcome</a>
<ul class="hide">
<li><a href="other.php" target="content">blank</a> </li>
</ul>
</li>
<li><a href="view_form.php" target="content">Student Nurse</a></li>
<li><a href="http://www.google.com" target="content">Internet</a></a></li>
<li><a href="http://support.site" target="content">Support</a></li>
<li><a href="">Policies</a>
<ul class="hide">
<li><a href="shared/Policies/ContactList.txt" target="content">Policy 1</a></li>
</ul>
</li>
</ul>
</div>
the jquery to make the submenus hide and show:
$('#menu li').css("margin-left","20px");
$('#menu li').toggle(
function() {
$(this).find('ul').show();
},
function() {
$(this).find('ul').hide();
});
This code works perfectly for expanding and collapsing the submenus, however, none of the links work now? I don't understand what I'm missing?
edit: firebug output:
<div id="navmenu">
<ul id="menu">
<li style="margin-left: 20px;">
<a target="content" href="welcome.html">Welcome</a>
<ul class="hide">
<li style="margin-left: 20px;">
<a target="content" href="view_form.php">a blank one here</a>
</li>
</ul>
</li>
<li style="margin-left: 20px;">
<a target="content" href="view_form.php">Student Nurse</a>
</li>
<li style="margin-left: 20px;">
<a target="content" href="http://www.google.com">Internet</a>
</li>
<li style="margin-left: 20px;">
<a target="content" href="http://support.site">Support</a>
</li>
<li style="margin-left: 20px;">
<a href="">Policies</a>
<ul class="hide">
<li style="margin-left: 20px;">
<a target="content" href="shared/Policies/ContactList.txt">Policy 1</a>
</li>
</ul>
</li>
</ul>
</div>
so the links are correct even when the submenu's are expanded but they are still broken.