Miura-shi
Miura-shi

Reputation: 4519

Bootstrap Mobile Dropdown menu links not clickable

I am using the latest version of Twitter Bootstrap ( 2.3.2 ) as the framework for my site.

The only issue I have run into with Bootstraps navmenu is that when viewing the site on my phone, the dropdown links are not clickable. When you try to click the link the menu closes. Links outside of the dropdown work just fine though. I checked in my bootstrap-dropdown.js and looked for a recommended line of code I found on a GitHub discussion that is supposed to fix the issue but it was already there. What's the fix for this? I appreciate any help with this matter.

  /* APPLY TO STANDARD DROPDOWN ELEMENTS
   * =================================== */

$(document)
.on('click.dropdown.data-api', clearMenus)
.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);

Upvotes: 2

Views: 2803

Answers (1)

Saroj
Saroj

Reputation: 1128

I experienced the same issue. The submenus were not clickable on my mobile. I added the following javascript and it seems to work.

jQuery(document).ready(function($) {
    $("li.dropdown a").click(function(e){
        $(this).next('ul.dropdown-menu').css("display", "block");
        e.stopPropagation();
        });
});

Upvotes: 4

Related Questions