Twitter Bootstrap: Call a js function when a dropdown is closed

前端 未结 6 1359
执念已碎
执念已碎 2020-12-13 23:59

Is there an event that I can tie into that is fired when a bootstrap dropdown is closed or toggled?

6条回答
  •  有刺的猬
    2020-12-14 00:52

    Nolan, I assume what you mean by "This did not work" is: when the user clicks anywhere else on the page and not properly closes the button/dropdown. You can monitor those clicks (anywhere on the document) by:

    $(document).click(function() {
        //check which element was clicked on
    });
    

提交回复
热议问题