Search code examples
htmlcssaccordionsemantic-ui

Semantic UI Accordion not working properly


I have an accordion element in my page. The problem is that the accordion appears on the page but it is not clickable. By 'not clickable', I mean that when I click on the header it does not expand to reveal the contents. Nothing happens at all. I hope someone can help.

Thanks in advance.


Solution

  • Your jQuery.js module must be loaded before the semantic-ui accordion.js module.

    Simply put

    <script src="js/accordion.js"></script>
    

    after

    <script src="js/vendor/jquery-1.11.2.min.js"><\/script>
    

    ( or whatever your jQuery version is ... )

    and initialize the accordion in the html document inside a script tag as :

    <script language='javascript'>
                 $(document).ready(function(){
                    $('.ui.accordion').accordion();
                 });
    </script>