Bootstrap Navbar. When I press the button nothing happens

前端 未结 2 1563
春和景丽
春和景丽 2020-11-28 17:05

I have a problem with my navbar. When the screen is small a Button appear, but when I press the button nothing happens.

This is my code and i don\'t really know why

相关标签:
2条回答
  • 2020-11-28 17:24

    What is missing is a reference to jquery.js. I created jsfiddle to demonstrate it.

    Please note that you need to reference jquery.js before referecing bootstrap.js

    Your html head should look like:

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js">  </script>
    

    Hope this works

    0 讨论(0)
  • 2020-11-28 17:38

    Have you including all the necessary JavaScript? Check if you have bootstrap's JavaScript file included or you can just download Bootstrap's collapse.js

    0 讨论(0)
提交回复
热议问题