简体   繁体   English

多级水平菜单CSS

[英]Multi-Level Horizontal Menu CSS

I need to create a Horizontal Menu, which spans 3 levels deep (Top Nav, Sub Nav, SubSub Nav). 我需要创建一个水平菜单,该菜单跨越3个级别的深度(顶部导航,子导航,子子导航)。

I have found examples, such as this CodePen that spans 2 levels, but I'm not strong enough in Jquery to make the third level work. 我发现了一些示例,例如横跨2个级别的CodePen ,但是我在Jquery中不够强,无法使第3个级别正常工作。

$(function() {
$('li a').click(function(e) {
    e.preventDefault();
    var $this = $(this);
    $this.closest('ul').children('li').removeClass('active');
    $this.parent().addClass('active');
    });
});

The Top Nav, and Sub Nav can be visible at all times, however, the SubSub Nav only needs to be visible if the Sub nav is clicked. “顶部导航”和“子导航”始终都可见,但是,仅在单击“子导航”时才需要“子导航”。

I have another open question regarding working my existing code to be compatible with JQuery 1.8.2, but if that's not the case, I would love to be able to do this in pure CSS. 关于使我现有的代码与JQuery 1.8.2兼容,我还有一个悬而未决的问题,但是如果不是这样,我希望能够在纯CSS中做到这一点。 Here is the code to my current menu JsFiddle . 这是我当前菜单JsFiddle的代码。

Does anyone have an example of a multi-level menu system that doesn't involve a dropdown? 有没有人有一个不涉及下拉菜单的多级菜单系统示例? Essential what I'm trying to do is display the users active progress on a website, so it's more a visual aid than a menu, but it will be clickable to navigation to previous sections, if needed. 我要执行的基本操作是在网站上显示用户的活动进度,因此它比菜单更能提供视觉帮助,但是如果需要,可以单击导航到上一部分。

here is the link for pure css link, you can try out! 这是纯css链接的链接,您可以尝试一下! http://www.cssscript.com/create-a-multi-level-drop-down-menu-with-pure-css/ http://www.cssscript.com/create-a-multi-level-drop-down-menu-with-pure-css/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM