SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Collapsing Menu

  1. #1
    Under Construction Poop_Shoot's Avatar
    Join Date
    Jul 2003
    Location
    Sacramento, CA
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Collapsing Menu

    I have the following script I was tinkering around with! And I cant seem to get figure out how to allow toggle of all menus collapsing at once or just one at a time! Am I making sence?

    Code:
    <html>
     <head>
      <script language="Javascript">
    function dis(Menu)
    {
    el=document.getElementById("menu"+Menu).style;
    d=(el.display=="block")?"none":"block"; 
     switch(Menu)
     {
     case 1:
     el.display=d;
     case 2:
     el.display=d; 
     case 3:
     el.display=d;
     case 4:
     el.display=d;
     
     }
    
    }
    </script>
    <style>
    .menu{display:none;}
    </style>
     </head>
     <body>
     <div onclick="dis(1);">menu1</div>  
     <div id="menu1" class="menu">sub ****</div>
     <div onclick="dis(2);">menu2</div>  
     <div id="menu2" class="menu">sub ****</div>
     <div onclick="dis(3);">menu3</div>  
     <div id="menu3" class="menu">sub ****</div>
     <div onclick="dis(4);">menu4</div>  
     <div id="menu4" class="menu">sub ****</div>
    
     </body>
    </html>

  2. #2
    SitePoint Addict
    Join Date
    Mar 2002
    Posts
    327
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look at the source of my site below.

    Nick
    All4YourPC for all your PC needs. Custom software.
    Websites. Web marketing. Training.
    http://members.aol.com/nickjc67

  3. #3
    Under Construction Poop_Shoot's Avatar
    Join Date
    Jul 2003
    Location
    Sacramento, CA
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont see a link! I might just be on one!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •