"Nav-bar Dropdown Multi-Level Open"
Bootstrap 3.3.0 Snippet by johne

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <nav class="navbar navbar-default navbar-static-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"> <img alt="JCR" src=""></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Opt1 Level 1 <span class="caret"></span></a> <ul class="dropdown-menu"> <li class="dropdown-submenu"> <a tabindex="-1" href="#">Opt1-1 Level 2</a> <ul class="dropdown-menu"> <li><a tabindex="-1" href="#">Op1-1 1</a></li> <li><a href="#">Opt1-1 2 </a></li> <li><a href="#">Opt1-1 3 </a></li> </ul> </li> <li><a href="#">Opt1-2</a></li> <li><a href="#">Opt1-3</a></li> <li role="separator" class="divider"></li> <li><a href="#">Opt1-last</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Opt2 Level 1 <span class="caret"></span></a> <ul class="dropdown-menu "> <li><a href="#">Opt2-1</a></li> <li><a href="#">Opt2-2</a></li> <li><a href="#">Opt2-3</a></li> <li role="separator" class="divider"></li> <li><a href="#">Opt2-last</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Opt3 Level 1 <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Op3-1</a></li> <li><a href="#">Op3-2</a></li> <li><a href="#">Op3-3</a></li> <li role="separator" class="divider"></li> <li><a href="#">Op3-last</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
.dropdown-submenu { position: relative; } .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -1px; -webkit-border-radius: 0 6px 6px 6px; -moz-border-radius: 0 6px 6px; border-radius: 0 6px 6px 6px; } .dropdown-submenu .open > .dropdown-menu { display: block; } .dropdown-submenu > a:after { display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #ccc; margin-top: 5px; margin-right: -10px; } .dropdown-submenu .open > a:after { border-left-color: #fff; } .dropdown-submenu.pull-left { float: none; } .dropdown-submenu.pull-left > .dropdown-menu { left: -100%; margin-left: 10px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; }
$(function() { /** * NAME: Bootstrap 3 Multi-Level by Johne * This script will active Triple level multi drop-down menus in Bootstrap 3.* */ $('li.dropdown-submenu').on('click', function(event) { event.stopPropagation(); if ($(this).hasClass('open')){ $(this).removeClass('open'); }else{ $('li.dropdown-submenu').removeClass('open'); $(this).addClass('open'); } }); });

Related: See More


Questions / Comments: