jquery - Twitter Bootstrap - Sidebar Dropdown Icon -


okay, first of all, here's site: http://songfreek.com/

on sidebar navigation, i've got dropdown menu's working. however, want icon change between pointing right <i class="icon-angle-right"></i> , pointing down <i class="icon-angle-down"></i> depending on state code in (closed or opened).

here's code repeats each menu:

<!-- user -->                         <li class="nav-header">                             <a href="#" data-toggle="collapse" data-target="#usermenu">                                 <font color="#333333">user</font> <i class="icon-angle-down"></i>                             </a>                             <ul style="list-style: none;" class="collapse in" id="usermenu">                                 <li class="active"><a href="#"><i class="icon-home"></i> home</a></li>                                 <li><a href="#"><i class="icon-envelope-alt"></i> messages <span class="badge badge-info">4</span></a></li>                                 <li><a href="#"><i class="icon-cogs"></i> settings</a></li>                                 <li><a href="#"><i class="icon-comment"></i> shoutbox</a></li>                                 <li><a href="#"><i class="icon-user"></i> staff list</a></li>                                 <li><a href="#"><i class="icon-flag"></i> infractions</a></li>                                 <li><a href="#"><i class="icon-exclamation-sign"></i> rules &amp; regulations</a></li>                                 <li><a href="#"><i class="icon-off"></i> logout</a></li>                             </ul>                         </li>                          <!-- radio dj -->                         <li class="nav-header">                             <a href="#" data-toggle="collapse" data-target="#radiodjmenu">                                 <font color="#34ccff">radio dj</font> <i class="icon-angle-down"></i>                             </a>                             <ul style="list-style: none;" class="collapse" id="radiodjmenu">                                 <li><a href="#">information &amp; stats</a></li>                                 <li><a href="#">dj says</a></li>                                 <li><a href="#">request line</a></li>                                 <li><a href="#">timetable</a></li>                                 <li><a href="#">banned songs</a></li>                             </ul>                         </li> 

any appreciated. thanks!

you can using jquery..

$('[data-toggle=collapse]').click(function(){     $(this).find("i").toggleclass("icon-angle-right icon-angle-down"); }); 

i update bootply last question collapse menu..

toggle icon demo


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -