Wijmo UI for the Web
Initialize with All Panes Collapsed

Building on the Quick Start example, you can change two options to initialize your accordion with all panes closed.

  1. In the <head> section of your HTML file, replace the script that includes the document ready function with this one, which does the following:
    • Sets the requireOpenedPane option to false so that all of the panes can close.
    • Sets the selectedIndex option to -1 so that no pane is opened initially.
    All Panes Closed Script
    Copy Code
    <script type="text/javascript">
         $(document).ready(function () {
            $("#accordion").wijaccordion({
                header: "h2", 
                expandDirection: "right",
                requireOpenedPane: false,
                selectedIndex: -1
            });
        });
    </script>
  2. Save your HTML file and open it in a browser. The accordion initializes with all of the panes closed.

See Also

Reference

Widgets

 
Support Options