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 afte
For me, it worked adding to my styles:
.dropdown-backdrop {
z-index:0;
}
almost the same answer as Matthias, i hope it helps.
None of the usual answers seemed to fix our problem on Android. We tried the accepted answer here and a few javascript hacks as well: Bootstrap Collapsed Menu Links Not Working on Mobile Devices and http://alittlecode.com/fix-twitter-bootstraps-dropdown-menus-in-touch-screens/
Ultimately we discovered where the close was occurring and conditionally called clearMenus()
only if the links parent or grand parent did not have dropdown-submenu
class
$(document)
.on('click.dropdown.data-api', function (e) {
//fix start
var $parent = $(e.target).parent()
var $grandparent = $parent.parent()
if (!$parent.hasClass('dropdown-submenu') && !$grandparent.hasClass('dropdown-submenu')) {
clearMenus()
}
//clearMenus
//end fix
})
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}(window.jQuery);
Hope that helps!
Try this. It's work for me
@media only screen and (max-width: 768px) {
.dropdown-menu {
position: absolute;
}
}
$('.dropdown a').click(function(e) {
e.preventDefault();
setTimeout($.proxy(function() {
if ('ontouchstart' in document.documentElement) {
$(this).siblings('.dropdown-backdrop ').off().remove();
}
}, this), 0);
});
A temporary fix is to add
.dropdown-backdrop{
position: static;
}
to the css file.
I have fixed this issue.
My code is here
<li class="dropdown custom open"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> menu<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Sub menu</a></li>
<li><a href="#">Sub menu2</a></li>
</ul>
</li>
Add following style in your CSS fie.
@media (max-width: 767px) {
.dropdown.custom:hover .dropdown-menu {
visibility: visible;
display:block;
border-radius:0;
}
}
Visit: http://www.s4auto.co.za/