Stats

71 Contributors: 2 Tuesday, September 13, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Bootstrap Dropdowns

Parameters

MethodsExample
Call Via Javascript$('.dropdown-toggle').dropdown();
Toggles the dropdown$('.dropdown-toggle').dropdown('toggle')
Event TypeDescription
show.bs.dropdownThis event fires immediately when the show instance method is called.
shown.bs.dropdownThis event is fired when the dropdown has been made visible to the user (will wait for CSS transitions, to complete).
hide.bs.dropdownThis event is fired immediately when the hide instance method has been called.
hidden.bs.dropdownThis event is fired when the dropdown has finished being hidden from the user (will wait for CSS transitions, to complete).
Event Handler Example$(element).on('show.bs.dropdown', function () { // do something… })

Remarks

When calling Dropdown Via Javascript $('.dropdown-toggle').dropdown(), the data-api i.e data-toggle="dropdown" still required. Read More

Related Examples