my question is simple but documentation or google is sparse about that…
I have a notification dropdown that I want to reload by ajax each time that exact dropdown is closed.
I just need to know which element do I need to listen to : the .dropdown
? .dropdown-toggle
? Or .dropdown-menu
?
Here is my code sample with IDs to be more specific :
<li class="dropdown" id='notif_drp'>
<a id="notif_toggle" href="#" data-toggle="dropdown" class="dropdown-toggle">Open</a>
<ul id='notif_ul' class="dropdown-menu">
<li>Notification 1</li>
</ul>
</li>
2
Answers
You can bind bootstrap’s event, which is shown here.
There are 4 event you can use.
And I made an example. http://jsbin.com/gudevoxara/edit?html,console,output
From twitter bootstrap docs
So for your example the
li
tag with classdropdown
and idnotif_drp
You can see it at codepen