responsive

closeSlides()

  • Available since: 1.2
  • Type: public method
  • Return value: instance of the accordion

Method closes all slides (i.e. sets the same size for all the slides). Method takes effect only if one of the slide is open and autoplay is disabled.

Method calling

1) Method can be called inside every callback function (as demonstrated in demo 1):

 this.closeSlides(); 

2) In case there is only one element matching the selector, method can be called anywhere in your code (as demonstrated in demo 2):

$('selector').data('jAccordion').closeSlides();

3) In case there are more elements matching the selector, method can be called anywhere in your code (eq(index) specifies index of accordion instace):

$('selector').eq(index).data('jAccordion').closeSlides();

Demo 1

  • Source files of this demo are located in: Examples\APIcloseSlidesDemo1

Demo 1 demonstrates how to call the described method inside callback function onAccordionMouseLeave() (the protocol is the same for all callback functions). All slides are closed after cursor leaves the accordion. Demo is only for demonstration purpose and is pointless but it's sufficient for demonstration purpose. You can use option sticky with value false to gain the same effect.

Loading content...
slide1
slide2
slide3
slide4
slide5

Demo 2

  • Source files of this demo are located in: Examples\APIcloseSlidesDemo2

Demo 2 demonstrates how to call the described method anywhere in your code. First open any slide by moving cursor over it and then click button below accordion to close all slides.

Loading content...
slide1
slide2
slide3
slide4
slide5

jAccordion by maniacpc, exclusively for CodeCanyon