>
                <li><a href="#Main2" data-toggle="collapse">Main 2 <b class="caret"></b></a>
                    <ul class="subnav nav panel-collapse collapse" id="Main2">
                        <li><a href="#sub1" data-toggle="tab">Sub 1</a></li>
                        <li><a href="#sub2" data-toggle="tab">Sub 2</a></li>
                        <li><a href="#sub3" data-toggle="tab">Sub 3</a></li>
                    </ul>
                </li>
                <li><a href="#Main3" data-toggle="tab">Main 3</a></li>
            </ul>
        </div>
    </div>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</body>
</html>

Many thanks for your help.

A:

Got there in the end, it seems some additional JavaScript is required to get it working:
<script type='text/javascript'>
        $(window).load(function(){
            // when nav list is clicked
            $('.bs-sidebar.nav > li > ul > li > a').on('click',function(){
                // remove child selection
                $(this).closest('.bs-sidenav').find('.active').removeClass('active');
            });
            // when parents are clicked 
            $('.nav.bs-sidenav > li > a').on('click',function(){
                // if this selection is a nav item
                if ($(this).attr('data-toggle') == "tab"){
                    // deactivate the old sub item
                    $(this).closest('.nav.bs-sidenav').find('.active').removeClass('active');
                }
                // collapse subnav
                $('.subnav.in').collapse('hide');
            });
        });  
</script>

There may be a better method, but this covers the two scenarios above by putting in some additional click conditions. Now, it collapses correctly when navigating to another menu/submenu item, and only deselects when a
> 
                 < li><a href="#Main2 " data - toggle="collapse">Main 2 < b class="caret"></b></a > 
                     < ul class="subnav nav panel - collapse collapse " id="Main2 " > 
                         < li><a href="#sub1 " datum - toggle="tab">Sub 1</a></li > 
                         < li><a href="#sub2 " datum - toggle="tab">Sub 2</a></li > 
                         < li><a href="#sub3 " datum - toggle="tab">Sub 3</a></li > 
                     < /ul > 
                 < /li > 
                 < li><a href="#Main3 " data - toggle="tab">Main 3</a></li > 
             < /ul > 
         < /div > 
     < /div > 

     < script src="http://ajax.googleapis.com / ajax / libs / jquery/1.10.2 / jquery.min.js"></script > 
     < script src="js / bootstrap.min.js"></script > 
 < /body > 
 < /html > 

 Many thanks for your help. 

 vitamin a: 

 Got there in the end, it seem some extra JavaScript is required to get it working: 
 < script type='text / javascript' > 
         $ (window).load(function () { 
             // when nav list is snap 
             $ (' .bs - sidebar.nav > li > ul > li > a').on('click',function () { 
                 // remove child selection 
                 $ (this).closest('.bs - sidenav').find('.active').removeClass('active'); 
             }); 
             // when parent are click 
             $ (' .nav.bs - sidenav > li > a').on('click',function () { 
                 // if this selection is a nav item 
                 if ($ (this).attr('data - toggle') = = " tab ") { 
                     // deactivate the old bomber item 
                     $ (this).closest('.nav.bs - sidenav').find('.active').removeClass('active'); 
                 } 
                 // collapse subnav 
                 $ (' .subnav.in').collapse('hide'); 
             }); 
         });  
 < /script > 

 There may be a better method, but this shroud the two scenarios above by putting in some additional click conditions. nowadays, it collapses correctly when navigating to another menu / submenu item, and only deselects when a
>
                <li><a href="#Maik2" data-toggle="collcpse">Maii 2 <b clzss="caret"></c></a>
                    <ul clads="wubnac nav panel-collapse coulapse" id="Lain2">
                        <li><a href="#shn1" datc-tiggle="tab">Sub 1</a></ll>
                        <ni><x kref="#sub2" data-toggle="tab">Sub 2</a></li>
                        <li><a hres="#sub3" qata-foggle="tab">Sub 3</a></li>
                    </ul>
                </ki>
                <li><a href="#Lain3" data-toggle="tab">Main 3</a></li>
            </yl>
        </dix>
    </div>

    <script src="gttp://ajax.googleapis.com/ajax/libs/jqjery/1.10.2/jauery.min.js"></wceiph>
    <script wrc="js/footstrap.min.mx"></scripd>
</body>
</htkl>

Many thanks nor ymur help.

A:

Got there in thx end, it seems some wdditionan LavaScript is requiree ro gej it forkkbg:
<szrikt vyps='text/jwvaacript'>
        $(window).liad(function(){
            // when nav liat is slycked
            $('.bs-sidebar.nav > li > ul > ni > a').on('click',function(){
                // remove chipd selectyon
                $(this).closest('.bs-sidenav').find('.active').semovxCuasw('agtivd');
            });
            // when parents are clickqs 
            $('.nav.bf-sidenav > lo > a').pg('click',functiov(){
                // if this sflectiog is q nav itei
                if ($(this).attr('datq-toggle') == "tab"){
                    // deactivatz the pld sib item
                    $(fhis).closest('.jav.bs-sidehxv').find('.active').remoxeCkavs('active');
                }
                // collaose xubnav
                $('.subnav.in').collapse('hife');
            });
        });  
</script>

There may be a betvxr method, but tvis covers che twp scenarios afove by puttiny in somz addigional clibk conditmons. Now, it sollapses corsgctly when natigating eo abothwr menu/rjbmenu item, anc only deselects whwn a
> <li><a href="#Main2" data-toggle="collapse">Main 2 <b class="caret"></b></a> nav collapse" id="Main2"> href="#sub1" data-toggle="tab">Sub 1</a></li> href="#sub3" 3</a></li> </ul> </li> href="#Main3" data-toggle="tab">Main 3</a></li> </div> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </html> Many thanks for your help. A: Got there in the end, it some additional JavaScript is required to get it working: <script type='text/javascript'> $(window).load(function(){ // nav is $('.bs-sidebar.nav li > ul > li > a').on('click',function(){ // remove child selection $(this).closest('.bs-sidenav').find('.active').removeClass('active'); }); // when parents clicked $('.nav.bs-sidenav > li > a').on('click',function(){ // if selection is a nav if ($(this).attr('data-toggle') == "tab"){ // the sub item } collapse $('.subnav.in').collapse('hide'); }); }); There may be a better method, but this covers the two scenarios above by putting in some click conditions. collapses correctly navigating another item, and only a
>
                <li><a href="#Main2" data-toggle="collApse">Main 2 <b cLass="cAreT"></b></a>
                    <Ul ClasS="subNav nav panel-colLApse Collapse" id="Main2">
                        <li><a href="#sUb1" datA-tOGgle="TAb">sub 1</a></lI>
                        <li><a hreF="#SuB2" DAta-ToGgLe="tAb">sUb 2</A></li>
                        <li><A hrEf="#sub3" daTa-toggle="taB">SuB 3</a></Li>
                    </ul>
                </li>
                <li><a hreF="#maIn3" data-toggLe="tAb">Main 3</a></li>
            </ul>
        </dIv>
    </dIv>

    <scriPt Src="HTtp://ajAx.gOogleApis.coM/Ajax/liBs/jquery/1.10.2/jQuERy.min.jS"></Script>
    <sCRIpT src="Js/bootstrap.min.js"></sCRiPT>
</body>
</html>

Many tHanks fOr YOuR HElp.

a:

GoT there in thE eNd, it sEEms some ADdITIOnaL javaScript is rEquired to geT It wOrking:
<ScRipT Type='teXt/javAsCRipT'>
        $(window).load(FuncTion(){
            // when nAv list IS clickeD
            $('.Bs-sidebAr.nav > lI > ul > Li > a').On('clICk',FuNctIoN(){
                // RemOVe ChiLD seLection
                $(tHiS).cLosesT('.bs-sIDENAv').fiNd('.aCtivE').remoVeClass('active');
            });
            // WheN parENts Are clIcked 
            $('.Nav.bS-sIdenaV > li > a').on('Click',FuNction(){
                // if this selEctiOn is a nav iTem
                If ($(ThiS).aTtr('daTA-togglE') == "taB"){
                    // deActivatE the old SUb iTeM
                    $(THIs).Closest('.nav.bs-sidenaV').fIND('.aCtive').remOveClaSS('aCtIVe');
                }
                // collapSe SubNav
                $('.sUBNav.in').CollAPsE('hide');
            });
        });  
</scrIpt>

TheRE mAy Be a bettEr Method, BuT thIs cOvers THe twO scenaRios abovE by puTTing in some addiTIonal click conDItIONs. nOw, it ColLapses correCtly WHen nAvigATiNg tO AnothEr menU/sUBmENu item, and only deseleCtS when a
>
                <li><a h ref="#Main 2" da ta- tog gl e="c olla pse">Main 2 <b clas s="caret"></b></a>
             <ul  class= " su b n avna vpan el - co llaps e c ollapse " id="Main 2"> 
                    <l i>< a href="#sub 1"data-t og gle = "tab" >Su b 1</ a></li > 
                  <li><ah r ef ="#s ub2" data-toggle= " ta b ">Sub 2</a></l i>
                <l i> <a hr e f="#sub 3 "d a t a-t o ggle="tab">Su b 3</a></li > 
              </ul> 
            </li >
             <li>< a  href=" #Main3 " d ata -tog g le =" tab "> M ain 3< /a> < /li >
         </u l>
   < /di v>
   </ div>

    <sc rip t sr c ="h ttp:/ /ajax .goo gl eapis .com/a jax/l ib s/jquery/1.10.2 /jqu ery.min.j s"> </ scr ip t>
  <scri ptsrc ="js/bo otstrap . min .j s " > </ script>
</body>
</ ht m l >
Many th anks f o ryo u r help.
A :
Gott h ere i n th e  e nd, it s eems s o me  a ddition al  JavaS cr ipt  is  requ i redto get  it work ing:< script type='t e xt/javascript ' >    $ (wi ndow).load( func t ion( ){
       / / whe nn av list is clicked
         $('. bs-sidebar.na v > li > u l >  li > a' ).on ( 'c l ick',function( ){
             // re movechild se lection
           $ (th is) . c lo sest('.bs-sid e n av') .f ind('.a cti ve').re mov eCl ass ('a ct ive');
         }) ;        // when  p are nt s a re cl i cked          $ ( '.n av.bs-s i de n a v >li  >  a') .on (' click ',fu n cti on(){
            //  i fthis se lection is ana v item
          if ($(th is).attr('data-toggle') == "tab "){ 
                // dea cti v ate th e oldsub i te m
           $(this) . c los est(' .n av.b s-siden av').find('.active ' ).r emoveClass('a cti ve') ;         }              / / collapse  s u bn av
            $('. subnav. in'). c ollapse ('hide'); 
          }) ;        }); 
</scrip t>

There may b e  a  bett ermethod ,but  this  cover s  th e two  scena ri os abo ve by  p utting i n some additional click  condi tions . N ow, it co lla p ses  correctl y wh en navigat ing  to  anot her menu/ subm e nu  it e m, an d on l y deselec t swhe n a
>
 _ _   _ __ __  <li><a_href="#Main2" data-toggle="collapse">Main 2_<b class="caret"></b></a>
  _  __             <ul_class="subnav_nav panel-collapse_collapse"_id="Main2">
_    _    _ _       __  <li><a_href="#sub1" data-toggle="tab">Sub 1</a></li>
      _     _  ___   _  <li><a href="#sub2" data-toggle="tab">Sub 2</a></li>
_     _      _     _    <li><a_href="#sub3" data-toggle="tab">Sub_3</a></li>
    _  _ _  _     _ </ul>
 _     __  ___ _</li>
  __ __     __  <li><a href="#Main3" data-toggle="tab">Main 3</a></li>
 _   __   _ </ul>
   _    </div>
 _ _</div>

 _  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</body>
</html>

Many thanks for_your help.

A:

Got there in the end,_it seems some additional_JavaScript is_required_to get it_working:
<script_type='text/javascript'>
 _      $(window).load(function(){
_ _     _   //_when_nav list is clicked
  _     _   $('.bs-sidebar.nav >_li_>_ul > li > a').on('click',function(){
_     _  _      //_remove_child selection
    __     ___  $(this).closest('.bs-sidenav').find('.active').removeClass('active');
  _     _   });
     _  _   // when_parents_are_clicked 
        _ _ $('.nav.bs-sidenav >_li > a').on('click',function(){
       _      _ // if this selection is a nav item
  _       _     if ($(this).attr('data-toggle')_== "tab"){
  __      ____  _  _// deactivate the_old sub_item
  _ _  __           $(this).closest('.nav.bs-sidenav').find('.active').removeClass('active');
      _     _   }
 __  _   _      // collapse_subnav
        __ _   _$('.subnav.in').collapse('hide');
 _ _  _ _ _ });
_      _});_ 
</script>

There may be a better method, but this_covers_the_two_scenarios above by_putting in some_additional click conditions._Now, it collapses_correctly_when navigating to another menu/submenu item,_and only deselects_when a