Expandable and collapsible menu

Hi All,

Can anyone give me a good sample code of an expandable/collapsible menu in plain javascript and html only.
I have seen a lot from the Internet but it seems they are using a third party tools.

Thanks in advance.

redshadowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZvonkoSystems architectCommented:
Perhaps this: http:Q_21421534.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
archrajanCommented:
Try here:
http://inspire.server101.com/js/ecms/

they have an example with a explanation
0
jouwstrmCommented:
I strait CSS for my menus.
You need to go here: http://www.xs4all.nl/~peterned/csshover.html
and download the csshover.htc file, and include it in the same directory as your css file.

In your css file or style tag, put: http://www.htmldog.com/articles/suckerfish/bones/ (view source)

body { behavior:url("csshover.htc"); }            /*makes any :hover class work with IE */
ul { /* all lists */
      padding: 0;
      margin: 0;
      list-style: none;}

li { /* all list items */
      float: left;
      position: relative;
      width: 10em;
}

li ul { /* second-level lists */
      display: none;
      position: absolute;
      top: 1em;
      left: 0;
}

li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
      top: auto;
      left: auto;
}

li:hover ul, li.over ul { /* lists nested under hovered list items */
      display: block;
}



in your HTML File: http://www.alistapart.com/articles/dropdowns/

<ul>
  <li>Sunfishes
    <ul>
      <li><a href="">Blackbanded»
        sunfish</a></li>
      <li><a href="">Shadow bass</a></li>
      <li><a href="">Ozark bass</a></li>
      <li><a href="">White crappie</a></li>
            </ul>
      </li>

  <li>Grunts
    <ul>
      <li><a href="">Smallmouth grunt
        </a></li>
      <li><a href="">Burrito</a></li>
      <li><a href="">Pigfish</a></li>
    </ul>
  </li>
  <li>Remoras
    <ul>
      <li><a href="">Whalesucker</a></li>
      <li><a href="">Marlinsucker</a></li>
      <li><a href="">Ceylonese remora</a></li>
      <li><a href="">Spearfish remora</a></li>
      <li><a href="">Slender suckerfish</a></li>
    </ul>
  </li>
</ul>

Hope those few sites help you.
I'll never use anything else besides list controled menus from now on.

Mike
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

jouwstrmCommented:
no javascript is needed
0
ZvonkoSystems architectCommented:
That is realy great! Never thought such things work :)
        li:hover ul { display: block; }
0
redshadowAuthor Commented:
Thanks for the link ZVonko that is exactly what  I need.
jouwstrm ,  your sample is also good and I might need it too.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.