开发者

adding subchilds in menu

I need to create menu with transition effect.here is the link for the menu. http://files.www.gethifi.com/images/nicer-navigation-with-css-transitions/demo.html Its is same as what i expected.开发者_开发问答 But in this menu we have parent elements and child elements. Ineed to add sub child elements also.. What change should we need to make..?help me..


Hi heres an answer using jQuery:

HTML:

<li>
  <a href="#">Widgets</a>
  <ul>
    <li><a href="#">Im another menu</a></li>           
    <li><a href="#">Im another menu</a></li>
    <li><a href="#">Im another menu</a></li>
    <li><a href="#">Im another menu</a></li>
  </ul>
</li>

jQuery:

$("#trans-nav").find("li").each(function(){
    //alert("hover");
    $(this).hover(function(){
        $(this).find("ul:first").attr('style','display:block');            
    });
});

CSS:

#trans-nav li ul li ul{
  display:none;
  position:absolute;
  top:0;
  left:8em;
  background: #63867f;
  width:8em;
}

#trans-nav li ul li ul li a {
  background: #63867f; 
 padding-right:0;
}

See it in action on jsfiddle here - http://jsfiddle.net/6Xa8k/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜