How to open Bootstrap dropdown programmatically

后端 未结 16 1917
轮回少年
轮回少年 2020-12-01 13:56

I\'m trying to open a Bootstrap dropdown when I click a item of another dropdown.

The idea is to select a city from the first drop down - then the script will auto o

16条回答
  •  星月不相逢
    2020-12-01 14:02

    Bootstrap's dropdown plugin waits for 'click.bs.dropdown' event to show the menu, so in this case:

    $('#sidebar_filter_areas').trigger('click.bs.dropdown');
    

    should work. This will not trigger other 'click' events on same element if any.

提交回复
热议问题