i want toggle bootstrap dropdown dropdown('toggle') method not toggle drop down (open on first click doesn't close when clicked again). want through dropdown('toggle') method. using following code:
javascript-
$(function(){ $(".dropdown-toggle").click(function(){ $(this).dropdown('toggle'); }); });
html-
<div class="dropdown"> <a href="#" class="dropdown-toggle">dropdown <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="#">action</a></li> <li><a href="#">another action</a></li> <li><a href="#">something here</a></li> </ul> </div>
it great if tell me example on, how enable multiple drop down in navbar manually using javascript.
fiddle of code at: http://jsfiddle.net/alaxmenon/hnl3c/
if not want use data attributes need this:
$('.dropdown-toggle').click(function(){ $(this).next(".dropdown-menu").toggle(); });
dropdown('toggle')
won't work unless use data attributes.
bootply: http://www.bootply.com/67728
Comments
Post a Comment