javascript - How to open bootstrap dropdown by external button click -
i've read half of internet, find clear example on how this. bunch of "solutions" nothing works far..
here's tried:
$('#openner').on('click', function(e){ e.preventdefault(); // nothing works bellow :( //$('.dropdown-toggle').trigger('click'); //$('.dropdown-toggle').click().parent().addclass('open'); //$('.dropdown-toggle').trigger('click.bs.dropdown''); $('.dropdown-toggle').click().addclass('open'); });
try:
$('#openner').on('click', function(e){ $('ul[aria-labelledby="dropdownmenu1"]').toggle(); });
jsfiddle: http://jsfiddle.net/mluarcdc/4/
Comments
Post a Comment