Learning
Learning

Reputation: 20051

Horizontal multilevel menus using css & Jquery

I am trying to make a simple horizontal list Menu showed in this example, So far i have copied List & CSS to jsFiddle ( New Example Update)but it doesn't seem to work how i make it work in a similar fashion. I am not able to find similar example which i can look into & replicate.

I would appreciate help in this regard.

<ul>
<li><a  href="index.html">Home</a></li>
<li><a  href="about.html">About</a></li>
<li><a  href="services.html">Services</a>
    <ul>
      <li><a  href="graphic-design.html">Graphic Design</a></li>
       <li><a href="web-design.html">Web Design</a></li>
      <li><a href="multimedia.html">Multimedia</a></li>
      <li><a href="exhibitions.html">Exhibitions</a></li>
       <li><a href="trademarketing.html">Trade Marketing</a></li>
    </ul>
</li>
<li><a href="work.html">Work</a></li>
<li><a href="clients.html">Clients</a></li>
<li><a href="wordpress">Blog</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>

CSS

nav#mainnav ul {
    bottom: 57px;
    height: 0;
    list-style: none outside none;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 0;
}
nav ul {
    list-style: none outside none;
}
ol, ul {
    color: #242320;
    font-size: 0.8em;
    font-weight: bold;
    line-height: 1.3em;
    margin: 10px 40px;
}
ul {
    margin-left: 30px;
}

UPDATE:

I am able to make it work as horizontal menu, but i am not able fade out the submenu after some time how can i do that Example Update

Upvotes: 0

Views: 2011

Answers (1)

Jai
Jai

Reputation: 74738

Try this: http://jsfiddle.net/7uWyf/8/

$('ul li').hover(function() { // hover on main li
  $('ul', this).show(); // if this will have an ul, will show it
}, function() {
  $('ul', this).hide(); // when mouse is out anywhere in doc area will hide it.
});

Upvotes: 1

Related Questions