Bootstrap Dropdown menu is not working

后端 未结 18 619
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 23:18

I am having trouble getting my dropdowns to work. I can get the navbar to show up perfectly, but when I click on \"Dropdown\" (either of them) it does not display the dropdo

相关标签:
18条回答
  • 2020-11-30 23:49

    In my case, disabling Chrome Extensions fixed it. I removed them from Chrome one by one until I found the culprit.

    Since I'm the author of the offending Chrome extension, I guess I better fix the extension!

    0 讨论(0)
  • 2020-11-30 23:52

    I had a bootstrap + rails project, and dropdown worked fine. They stopped to works after an update...

    This is the solution that fixed the problem, add the following to .js file:

    $(document).ready(function() {
        $(".dropdown-toggle").dropdown();
    });
    
    0 讨论(0)
  • 2020-11-30 23:55

    In case anyone still facing same problem be sure to check your your view Page source in your browser to check whether all the jquery and bootstrap files are loaded and paths to the file are correct. Most important! make sure to use latest stable jquery file.

    0 讨论(0)
  • 2020-11-30 23:55

    My bootstrap version was pointing to bootstap4-alpha,

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"
    integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn"
    crossorigin="anonymous"></script>
    

    changed to 4-beta

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"
            integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"
            crossorigin="anonymous"></script>
    

    and it started working

    0 讨论(0)
  • 2020-11-30 23:56

    100% working solution

    just place your Jquery link first of all js and css links

    Example Correct

    <script src="jquery/jquery.js"></script>
    <script type="text/javascript" src='js/bootstrap.min.js'></script>
    <link rel="stylesheet" href="css/bootstrap.css" />
    

    Example Wrong!

    <script type="text/javascript" src='js/bootstrap.min.js'></script>
    <link rel="stylesheet" href="css/bootstrap.css" />
    <script src="jquery/jquery.js"></script>
    
    0 讨论(0)
  • 2020-11-30 23:57

    I tried all the above answers and the only version who works for me is the jquery 1.11.1. I tried with all the other versions 1.3.2, 1.4.4, 1.8.2, 3.3.1 and navbar dropdown doesn't work.

    <script src="jquery/jquery-1.11.1.min.js"></script>
    
    0 讨论(0)
提交回复
热议问题