Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drop-Down Menu not working on mobile devices

The most recent version of twitter bootstrap (2.3.2) does seem to have a problem with drop down menus on mobile devices.

When you click on a drop-down menu item after opening the menu, the menu simply closes and no link gets clicked. You can see this on their sample page here: http://twitter.github.io/bootstrap/examples/hero.html

I found an issue posted at their github page but no solution: https://github.com/twitter/bootstrap/issues/7927

Does anybody know the trick to fix it?

like image 487
maddo7 Avatar asked Jul 10 '13 19:07

maddo7


People also ask

Why does my drop down menu not work?

Solution. The reason of this behaviour is the default setting for the mouse in Windows 10. By default the setting Scroll inactive windows when I hover over them in the Windows settings is turned on. If you switch this setting off, you can scroll again through large dropdown-menus.

Where is the drop down menu on Android?

You'll find it in the upper right corner of your IDE. Android pull-down menus in Android Studio are added using Spinners. If there is default text present on your application screen, head back to the code section and remove all the TextViews . Now, from the design palette, select Containers.

Why is wordpress mobile menu not working?

If the mobile menu starts to work, this means one of the plugins you deactivated was breaking it. Simply re-activate each plugin one-by-one until the menu breaks again. You can use this method to pinpoint the source of the error and remove any broken plugins. There may also be some broken javascript within a widget.


3 Answers

A temporary fix is to add

.dropdown-backdrop{
    position: static;
}

to the css file.

like image 109
maddo7 Avatar answered Sep 19 '22 18:09

maddo7


This worked for me:

$('.dropdown-toggle').click(function(e) {
  e.preventDefault();
  setTimeout($.proxy(function() {
    if ('ontouchstart' in document.documentElement) {
      $(this).siblings('.dropdown-backdrop').off().remove();
    }
  }, this), 0);
});

via robdodson on github

like image 40
Ryan Avatar answered Sep 18 '22 18:09

Ryan


For me, it worked adding to my styles:

.dropdown-backdrop {
    z-index:0;
}

almost the same answer as Matthias, i hope it helps.

like image 37
Raúl Contreras Avatar answered Sep 21 '22 18:09

Raúl Contreras