@extends('../layout/' . $layout) @section('subhead') Accordion - Midone - Tailwind HTML Admin Template @endsection @section('subcontent')

Accordion

Basic Accordion

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Boxed Accordion

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Methods

Get or Create Instance
Static method which allows you to get the accordion instance associated with a DOM element, or create a new one in case it wasn’t initialized.
                            
                                const myAccordion = tailwind.Accordion.getOrCreateInstance(document.querySelector("#myAccordion"));
                            
                        
Get Instance
Static method which allows you to get the accordion instance associated with a DOM element.
                            
                                const myAccordion = tailwind.Accordion.getInstance(document.querySelector("#myAccordion"));
                            
                        
Hide
Manually hides an accordion. Returns to the caller before the accordion has actually been hidden (i.e. before the hidden.tw.accordion event occurs).
                            
                                myAccordion.hide();
                            
                        
Show
Manually opens an accordion. Returns to the caller before the accordion has actually been shown (i.e. before the shown.tw.accordion event occurs).
                            
                                myAccordion.show();
                            
                        
Toggle
Manually toggles an accordion. Returns to the caller before the accordion has actually been shown or hidden (i.e. before the shown.tw.accordion or hidden.tw.accordion event occurs).
                            
                                myAccordion.toggle();
                            
                        

Events

Midone’s accordion class exposes a few events for hooking into accordion functionality. All accordion events are fired at the accordion itself (i.e. at the <div class="accordion">).
Event type Description
show.tw.accordion This event fires immediately when the show instance method is called.
hide.tw.accordion This event is fired immediately when the hide instance method has been called.
                            
                                const myAccordionEl = document.getElementById('myAccordion')
                                myAccordionEl.addEventListener('hidden.tw.accordion', function (event) {
                                    // do something...
                                })
                            
                        
@endsection