"multi level dropdown"
Bootstrap 3.0.0 Snippet by mmutuku

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.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 ----------> <div class="dropdown"> <a href="#"><i class="glyphicon glyphicon-list"></i><?php echo $allContent ?><span class="caret pull-right"></span></a> <a id="dLabel" role="button" data-toggle="dropdown" class="" data-target="#" href="/page.html"> All content <span class="caret"></span> </a> <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu"> <li><a href="#">Subject</a></li> <li class="divider"></li> <li class="dropdown-submenu"> <?php $resultSubjects = mysqli_query($conn,"SELECT * FROM stemSubjects") or (mysqli_error($conn)); while($recordSubjects = mysqli_fetch_assoc($resultSubjects)) { ?> <a href="#"><?php if($lang != 'lang_en'){ echo mysqli_real_escape_string ( $conn,$recordSubjects['frenchSubject'] );} else{echo mysqli_real_escape_string ( $conn, $recordSubjects['subject'] );} ?> </a> <ul class="dropdown-menu"> <li><a tabindex="-1" href="#">Class</a></li> <li class="divider"></li> <li class="dropdown-submenu"> <?php $resultClasses = mysqli_query($conn,"SELECT * FROM grades") or (mysqli_error($conn)); while($recordClasses = mysqli_fetch_assoc($resultClasses)) { ?> <a href="#"><?php echo mysqli_real_escape_string ( $conn, $recordClasses['class'] ); ?> </a> <ul class="dropdown-menu"> <li><a tabindex="-1" href="#">Category</a></li> <li class="divider"></li> <li> <?php $resultCategories = mysqli_query($conn,"SELECT * FROM categories") or (mysqli_error($conn)); while($recordCategories = mysqli_fetch_assoc($resultCategories)) { ?> <a href="#"><?php if($lang != 'lang_en'){ echo mysqli_real_escape_string ( $conn,$recordCategories['frenchCategory'] );} else{echo mysqli_real_escape_string ( $conn, $recordCategories['category'] );} ?></a></li> </ul> </li> </ul> </li> <?php }}} ?> </ul> </div>
.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:hover>.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:hover>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; }

Related: See More


Questions / Comments: