slidng menus

slidng menus

heya wonder if anyone can help me with a problem,

i have a menu on my site which uses the following code:

$(document).ready(function(){
                     
   $("ul.mainmenu>li a").click(function(){
   
         
         var whatmenu = $(this).attr("id");
         var openmenu = "#" + whatmenu + "-menu";
         
         $("ul.submenu").hide(1000);
         $(openmenu).show(1000);
         
               

                        return false;
                        });


and it works fine but i was wondering if there was a way for it to check to see if the menu is already open if so then close it, as it stands if u click on a menu which is open it will close it then open it again

cheers

vards
    • Topic Participants

    • alan