javascript - Using Span for Triggering Bootstrap Dropdown -
i have several icons in header used font , wrapped
<li style="margin-top: 15px"> <span class="myicons" id="messages" style="font-size: 5px">m</span> </li>
i want use trigger bootstrap dropdown in documentation, uses button , div and, couldn't figure out how trigger when clicked on font.
should try using jquery , try trigger dropdown open on click on #messages
?
you not have use <button>
's , <div>
's - important thing have data-toggle="dropdown"
on triggering element :
<ul class="dropdown"> <!-- markup --> <li style="margin-top: 15px" data-toggle="dropdown"> <span class="myicons" id="messages" style="font-size:5px">m</span> </li> <!--// markup --> <ul class="dropdown-menu"> <li><a href="#">action</a></li> <li><a href="#">another action</a></li> <li><a href="#">something else here</a></li> <li><a href="#">separated link</a></li> </ul> </ul>
demo -> http://jsfiddle.net/7ujpzs58/
Comments
Post a Comment