Last Updated: February 25, 2016
· 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.

     $('.navbar-toggle').bind( "touchstart", function(e){

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.

Have a fresh tip? Share with Coderwall community!

Post a tip