I am trying to change the default collapse behaviour in a responsive, bootstrap theme for wordpress but I am fairly sure my question relates specifically to Bootstrap.
When the screen width is reduced and the mobile menu icon (hamburger) is clicked on it triggers the collapsing menu. I would like to remove this javascript trigger event and create a new custom event.
The HTML for the button in the theme is:
<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>
I have tried using the following javascript to remove the default event but with no luck:
$('button.navbar-toggle').unbind();
$('button.navbar-toggle').off();
I have also tried applying the unbind() and off() methods to the spans within the button, but again with no luck.
I would be very grateful for any help with this.