I'm a newbie with jQuery and I'm trying to figure out this slideToggle function. How I want it to work is when you click on let's say #toolsnav the #tool-dropdown div slides down, which works perfect. But the problem is that the #tools-dropdown div doesn't go up when I click on the other nav divs, it stays down unless I click on it again. Thanks of your help : )
<script type="text/javascript">
$(document).ready(function() {
$("#toolsnav").click(function() {
$(".tools-dropdown").slideToggle("fast");
});
$("#showsnav").click(function() {
$(".shows-dropdown").slideToggle("fast");
});
$("#blognav").click(function() {
$(".blog-dropdown").slideToggle("fast");
});
$("#aboutnav").click(function() {
$(".about-dropdown").slideToggle("fast");
});
$("#joinnav").click(function() {
$(".join-dropdown").slideToggle("fast");
});
});
</script>
<nav id="main">
<ul>
<li><a href="#" id="toolsnav">Tools</a></li>
<li><a href="#" id="showsnav">Shows</a></li>
<li><a href="#" id="blognav">Blog</a></li>
<li><a href="#" id="aboutnav">About</a></li>
<li><a href="#" id="joinnav">Join</a></li>
</ul>
</nav>