semantic-ui dropdown menu do not work

后端 未结 7 1337
攒了一身酷
攒了一身酷 2020-12-09 01:42

I have been trying to build a menu using Semantic-UI. I can\'t get the dropdown menus to work at all. I took a copy of the page Menu examples and pulled out everything excep

相关标签:
7条回答
  • 2020-12-09 01:54

    One way is JS where you need to initialise script. Other way is to add a class "simple" to dropdown

    <div class="ui simple dropdown item">
    
    0 讨论(0)
  • 2020-12-09 01:54

    A quick note:

    If the dropdown is not displaying and Bootstrap has been loaded on the same page with semantic-ui, then make sure to load the semantic js library after bootstrap.

    This occurs because both bootstrap and semantic-ui have the same .dropdown() method used for displaying dropdown menus. That said, the last library to be loaded between semantic-ui and bootstrap will override all other .dropdown() methods that exists.

    0 讨论(0)
  • 2020-12-09 01:58

    it worked with me when I added the function line above

        <script> 
         $(document).ready(function(){
              $('.ui.dropdown') .dropdown();
        });
        </script>

    0 讨论(0)
  • 2020-12-09 02:02

    If you initialize with $('.ui.dropdown').dropdown(); also make sure your page references dropdown.js

    0 讨论(0)
  • 2020-12-09 02:04

    if the given answers didn't work for you, make sure you are not using bootstrap along with semantic-ui

    0 讨论(0)
  • 2020-12-09 02:07

    You need to initialize your dropdown like so:

    $('.ui.dropdown')
      .dropdown();
    

    There is more information HERE

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