responsive

prev()

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

Method opens the previous slide or the last slide if none or the first one is active.

Method calling

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

this.prev();

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').prev();

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').prev();

Demo 1

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

Demo 1 demonstrates how to call the described method inside callback function ready() (the protocol is the same for all callback functions). The last slide is open after accordion is fully loaded, which is pointless because you can use option defaultActiveSlideIdx instead but it's sufficient for demonstration purpose.

Loading content...
slide1
slide2
slide3
slide4
slide5

Demo 2

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

Demo 2 demonstrates how to call the described method anywhere in your code. You should consider using option prevBtn which is more suitable in most situations.

Loading content...
slide1
slide2
slide3
slide4
slide5

jAccordion by maniacpc, exclusively for CodeCanyon