"School Year Selectors"
Bootstrap 3.3.0 Snippet by RajeshPatadiya

<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 ----------> <div class="col-sm-4"> <div class="row"> <h2>Test of a nested school year filter</h2> <div class="dropdown"> <a id="ddYearChoice" role="button" data-toggle="dropdown" class="btn btn-primary" data-target="#" href="#"> Available Schools - 20152016<i class="caret"></i> </a> <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu"> <li class="dropdown-submenu"> <a href="#" tabindex="-1" class="year"> 20162017 </a> <ul class="dropdown-menu yearschools" data-year="20162017"> <li><a href="#" onClick="SY(this);">Atikokan High School</a></li> <li><a href="#" onClick="SY(this);">Fort Frances High School</a></li> <li><a href="#" onClick="SY(this);">Rainy River High School</a></li> <li class="divider"></li> <li><a href="#" onClick="SY(this);">Atikokan High School Elementary</a></li> <li><a href="#" onClick="SY(this);">Crossroads</a></li> <li><a href="#" onClick="SY(this);">Donald Young</a></li> <li><a href="#" onClick="SY(this);">J.W. Walker</a></li> <li><a href="#" onClick="SY(this);">Mine Centre</a></li> <li><a href="#" onClick="SY(this);">McCrosson-Tovell</a></li> <li><a href="#" onClick="SY(this);">Nestor Falls</a></li> <li><a href="#" onClick="SY(this);">North Star</a></li> <li><a href="#" onClick="SY(this);">Robert Moore</a></li> <li><a href="#" onClick="SY(this);">Riverview</a></li> <li><a href="#" onClick="SY(this);">Sturgeon Creek</a></li> <li class="divider"></li> <li><a href="#" onClick="SY(this);">Rainy River Night School</a></li> <li><a href="#" onClick="SY(this);">Rainy River Summer School</a></li> </ul> </li> <li class="dropdown-submenu"> <a href="#" tabindex="-1"> 20152016 </a> <ul class="dropdown-menu yearschools" data-year="20152016"> <li><a href="#" onClick="SY(this);">Atikokan High School</a></li> <li><a href="#" onClick="SY(this);">Fort Frances High School</a></li> <li><a href="#" onClick="SY(this);">Rainy River High School</a></li> <li class="divider"></li> <li><a href="#" onClick="SY(this);">Atikokan High School Elementary</a></li> <li><a href="#" onClick="SY(this);">Crossroads</a></li> <li><a href="#" onClick="SY(this);">Donald Young</a></li> <li><a href="#" onClick="SY(this);">J.W. Walker</a></li> <li><a href="#" onClick="SY(this);">Mine Centre</a></li> <li><a href="#" onClick="SY(this);">McCrosson-Tovell</a></li> <li><a href="#" onClick="SY(this);">Nestor Falls</a></li> <li><a href="#" onClick="SY(this);">North Star</a></li> <li><a href="#" onClick="SY(this);">Robert Moore</a></li> <li><a href="#" onClick="SY(this);">Riverview</a></li> <li><a href="#" onClick="SY(this);">Sturgeon Creek</a></li> <li class="divider"></li> <li><a href="#" onClick="SY(this);">Rainy River Night School</a></li> <li><a href="#" onClick="SY(this);">Rainy River Summer School</a></li> </ul> </li> <li class="dropdown-submenu"> <a href="#" tabindex="-1"> 20142015 </a> <ul class="dropdown-menu"> <li><a href="#">Atikokan High School</a></li> <li><a href="#">Fort Frances High School</a></li> <li><a href="#">Rainy River High School</a></li> <li class="divider"></li> <li><a href="#">Atikokan High School Elementary</a></li> <li><a href="#">Crossroads</a></li> <li><a href="#">Donald Young</a></li> <li><a href="#">J.W. Walker</a></li> <li><a href="#">Mine Centre</a></li> <li><a href="#">McCrosson-Tovell</a></li> <li><a href="#">Nestor Falls</a></li> <li><a href="#">North Star</a></li> <li><a href="#">Robert Moore</a></li> <li><a href="#">Riverview</a></li> <li><a href="#">Sturgeon Creek</a></li> <li class="divider"></li> <li><a href="#">Rainy River Night School</a></li> <li><a href="#">Rainy River Summer School</a></li> </ul> </li> <li class="dropdown-submenu"> <a href="#" tabindex="-1"> 20132014 </a> <ul class="dropdown-menu"> <li><a href="#">Atikokan High School</a></li> <li><a href="#">Fort Frances High School</a></li> <li><a href="#">Rainy River High School</a></li> <li class="divider"></li> <li><a href="#">Atikokan High School Elementary</a></li> <li><a href="#">Crossroads</a></li> <li><a href="#">Donald Young</a></li> <li><a href="#">J.W. Walker</a></li> <li><a href="#">Mine Centre</a></li> <li><a href="#">McCrosson-Tovell</a></li> <li><a href="#">Nestor Falls</a></li> <li><a href="#">North Star</a></li> <li><a href="#">Robert Moore</a></li> <li><a href="#">Riverview</a></li> <li><a href="#">Sturgeon Creek</a></li> <li class="divider"></li> <li><a href="#">Rainy River Night School</a></li> <li><a href="#">Rainy River Summer School</a></li> </ul> </li> <li class="dropdown-submenu"> <a href="#" tabindex="-1"> 20122013 </a> <ul class="dropdown-menu"> <li><a href="#" onClick="SY(this);">Atikokan High School</a></li> <li><a href="#" onClick="SY(this);">Fort Frances High School</a></li> <li><a href="#" onClick="SY(this);">Rainy River High School</a></li> <li class="divider"></li> <li><a href="#" onClick="SY(this);">Atikokan High School Elementary</a></li> <li><a href="#" onClick="SY(this);">Crossroads</a></li> <li><a href="#" onClick="SY(this);">Donald Young</a></li> <li><a href="#" onClick="SY(this);">J.W. Walker</a></li> <li><a href="#" onClick="SY(this);">Mine Centre</a></li> <li><a href="#" onClick="SY(this);">McCrosson-Tovell</a></li> <li><a href="#" onClick="SY(this);">Nestor Falls</a></li> <li><a href="#" onClick="SY(this);">North Star</a></li> <li><a href="#" onClick="SY(this);">Robert Moore</a></li> <li><a href="#" onClick="SY(this);">Riverview</a></li> <li><a href="#" onClick="SY(this);">Sturgeon Creek</a></li> <li class="divider"></li> <li><a href="#" onClick="SY(this);">Rainy River Night School</a></li> <li><a href="#" onClick="SY(this);">Rainy River Summer School</a></li> </ul> </li> </ul> </div> </div> </div> </div> <div class="col-sm-4"> <hr /><h2>Another possibility</h2> <div class="dropdown"> <a id="ddYearChoice2" role="button" data-toggle="dropdown" class="btn btn-primary" data-target="#" href="#"> Available Schools - 20152016<i class="caret"></i> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">Atikokan High - 20162017</a></li> <li><a href="#" onClick="SY2(this);">Fort Frances High - 20162017</a></li> <li><a href="#" onClick="SY2(this);">Rainy River - 20162017</a></li> <li class="divider"></li> <li><a href="#" onClick="SY2(this);">Crossroads Public - 20162017</a></li> <li><a href="#" onClick="SY2(this);">Donald Young - 20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> <li><a href="#" onClick="SY2(this);">--All--20162017</a></li> </ul> </div> </div> <div class="col-sm-4"> <hr /><h2>Another possibility</h2> <div class="dropdown"> <a id="ddYearChoice3" role="button" data-toggle="dropdown" class="btn btn-primary" data-target="#" href="#"> 20152016<i class="caret"></i> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <li><a href="#">20162017</a></li> <li><a href="#">20152016</a></li> <li><a href="#">20142015</a></li> <li><a href="#">20132014</a></li> <li><a href="#">20122013</a></li> <li><a href="#">20112012</a></li> <li><a href="#">20102011</a></li> </ul> </div> <div class="dropdown"> <a id="ddSchoolChoice3" role="button" data-toggle="dropdown" class="btn btn-primary" data-target="#" href="#"> Available Schools<i class="caret"></i> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <li><a href="#">Atikokan High</a></li> <li><a href="#">Fort Frances High</a></li> <li><a href="#">Rainy River High</a></li> <li class="divider"></li> <li><a href="#">Crossroads</a></li> <li><a href="#">Donald Young</a></li> <li><a href="#">Fort Frances High Elementary</a></li> <li><a href="#">J.W. Walker</a></li> <li><a href="#">Mine Centre</a></li> <li><a href="#">McCrosson-Tovell</a></li> <li><a href="#">Nestor Falls</a></li> <li><a href="#">Northstart</a></li> <li><a href="#">Robert Moore</a></li> <li><a href="#">Riverview</a></li> <li><a href="#">Sturgeon Creek</a></li> <li class="divider"></li> <li><a href="#">RR Night</a></li> <li><a href="#">RR Summer</a></li> </ul> </div> </div>
body {font-size: 8px!important;} .dropdown-submenu { position: relative; } .dropdown-menu, .dropdown-submenu, .dropdown>a {font-size: 10px;} .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; } .dropdown>li:hover > ul.dropdown-menu { display: block; }
function SY(a){ $("#ddYearChoice").html($(a).text() + "-" + $(a).closest(".yearschools").attr("data-year") + "<i class='caret'></i>"); } function SY2(a){}

Related: See More


Questions / Comments: