简体   繁体   English

Bootstrap 下拉列表与 jQuery.dropdown 冲突

[英]Bootstrap dropdown conflicting with jQuery.dropdown

I am trying to manually toggle a bootstrap dropdown.我正在尝试手动切换引导程序下拉列表。 This script used to work until recently:这个脚本一直工作到最近:

$(function () {
    $('.role-toggler').on('click', function (e) {
        $(this).find('.dropdown-toggle').dropdown('toggle');
        e.stopPropagation();
    });
});

However when I try click the dropdown now I get:但是,当我现在尝试单击下拉列表时,我得到:

Uncaught Error: Method toggle does not exists on jQuery.dropdown未捕获的错误:jQuery.dropdown 上不存在方法切换

I am using Material Design for Bootstrap , Bootstrap 3.3.6 and jQuery 2.1.4.我正在将Material Design 用于 BootstrapBootstrap 3.3.6和 jQuery 2.1.4。 I recently updated my packages which included bootstrap and jquery, which may have caused this issue.我最近更新了我的包,其中包括 bootstrap 和 jquery,这可能导致了这个问题。

The issue is probably that Bootstrap material design is now using a custom jQuery dropdown plugin which overwrites the bootstrap drowpdown but has a different minimal API.问题可能是 Bootstrap 材料设计现在使用自定义 jQuery下拉插件,该插件覆盖了引导下拉菜单,但具有不同的最小 API。

Try raising an issue mentioning that you expect a bootstrap like API since its a bootstrap theme.尝试提出一个问题,提到您期望像 API 这样的引导程序,因为它是引导程序主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM