[フレーム]
Last Updated: February 25, 2016
·
1.449K
· hi_dm

Faster Twitter Bootstrap Mobile Navigation

I have noticed that there is a half second or so delay between when you touch the .navbar-toggle and when the dropdown menu flies out.

This short delay might relate to how mobile browsers detect a click(). It seems that binding touchstart() to .navbar-toggle does the trick.

$(document).ready(function(){
 $('.navbar-toggle').bind( "touchstart", function(e){
 e.preventDefault();
 $('.navbar-collapse').collapse('toggle');
 });
});

It's important to note that touchstart() will interfere with mobile scrolling, so if your "hamburger" or .navbar-toggle target is larger than default it might be better to avoid this patch.

AltStyle によって変換されたページ (->オリジナル) /