Do we have events for the navbar-toggle
that appears when we are on the smaller screen?
For instance,
$('#myDropdown').on('shown.bs.navbar-toggle', function () {
// do something…
});
$('#myDropdown').on('hide.bs.navbar-toggle', function () {
// do something…
});
html,
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<a class="navbar-brand" href="#">Home</a>-->
</div>
Otherwise, how can we detect if that navbar-toggle
exists on the smaller screen?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…