Bootstrap 3.3 – dropdown mobile menu not working

Yah!,

For a client, who is using Bootstrap v3.3.7, the dropdown menus on mobile weren’t working properly.

When clicking on BTC-Alpha on a mobile device the menu would close.

The solution was to edit bootstrap.js and on line +- 818

if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
  // if mobile we use a backdrop because click events don't delegate
  $(document.createElement('div'))
   .addClass('dropdown-backdrop')
   .insertAfter($(this))
   .on('click', clearMenus)
}

comment

$(document.createElement('div')) 
.addClass('dropdown-backdrop')
.insertAfter($(this))
.on('click', clearMenus)

so we have something like this

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.