Added/updated in: All versionsVersion 1.0Version 1.1Version 1.2Version 1.2.1
Public API lets user control and modify behaviour of the plugin after its initialization.
Methods and variables can be accessed inside every callback function:
this.method(); //For methods this.variable; //For variables
In case there is only one element matching the selector, methods and variables can be accessed anywhere in your code:
$('selector').data('jAccordion').method(); //For methods $('selector').data('jAccordion').variable; //For variables
In case there are more elements matching the selector, variable can be accessed anywhere in your code (eq(index) specifies index of accordion instace):
$('selector').eq(index).data('jAccordion').method(); //For methods $('selector').eq(index).data('jAccordion').variable; //For variables
Method opens a slide with specified index - slideIndex (if not out of bounds). Slides are numbered from 0, which means that 1st slide = 0, 2nd slide = 1 etc. This method internally uses jQuery method eq, which means that you can use all of the advantages of this method such as goToSlide(-1) to open the last slide.
Method opens the first slide. This method has the same effect as goToSlide(0).
Method opens the last slide. This method has the same effect as goToSlide(-1).
Method opens the next slide or the first slide if none or the last one is active.
Method opens the previous slide or the last slide if none or the first one is active.
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 returns boolean value which determines whether a slide is opening or closing.
Method returns active slide (if there is one) as jQuery object or null.
Method returns index of active slide or -1 if none is selected. Slides are numbered from 0, which means that 1st slide = 0, 2nd slide = 1 etc.
Method returns boolean value which specifies whether autoplay is paused.
In the callback function, this always means instance of the accordion, which means that you can access any public variable or call any public API method using:
this.method(); //For methods this.variable; //For variables
Callback function to be executed after the accordion is fully loaded.
Callback function to be executed after a slide is completely open.
Callback function to be executed when a slide starts opening.
Callback function to be executed when a slide starts closing.
Callback function to be executed when cursor enters the accordion's direct children .jAccordion-slidesWrapper.
Callback function to be executed when cursor leaves the accordion's direct children .jAccordion-slidesWrapper.
Callback function to be executed when autoplay is paused, i.e. when cursor enters accordion's direct children .jAccordion-slidesWrapper.
Callback function to be executed when autoplay is resumed, i.e. when cursor leaves accordion's direct children .jAccordion-slidesWrapper.
Options are used to affect behaviour of jAccordion. Options may depend on others in which case it's mentioned in the description page of the option. Options are placed in configuraiton section of jAccordion and are separated by comma.
Example of configuration section of jAccordion:
$('.accordion').jAccordion({ activeSlideSize : 750, spacing : 3, sticky : true, autoplay : true, autoplayInterval : 5000, arrowKeysNav : true, nextBtn : $('.nextBtn'), prevBtn : $('.prevBtn') });
Specifies whether size (width/height) of accordion is automatically adjusted to fit size of content but max size (set via CSS) can't be exceeded.
Specifies whether height of active slide should be determined by its content.
Class which is added to active slide.
Amount of time for which a slide is displayed if using autoplay.
Index of slide which is open by default. All slides are closed if no value is set. Slides are numbered from 0. First slide equals 0, second slide equals 1, etc. Plugin internally uses jQuery method eq so you can set -1 to select the last slide.
Easing function used for animation of slides. jQuery library offers only two functions - 'swing' and 'linear' but you can use jQuery easing plugin to extend list of the functions. This plugin is included in all provided demos.
Mouse event used to trigger slide opening. Allowed values are 'click' and 'mouseenter'. Value 'click' is automatically used for handheld devices.
HTML element which is included in every slide (exactly one header per one slide). Clicking the header causes the slide to open/close.
Size (width/height) of inactive slide. If set then option activeSlideSize is not used (even if set).
Specifies whether to change height in the same proportion as width when width of the accordion is changed.
Clicking the element(s) causes opening of the next slide or the first one if none is active.
autoplay is paused when cursor enters accordion's direct children .jAccordion-slidesWrapper.
Specifies whether slides remain hidden until all of the images are fully loaded.
Duration (in milliseconds) of fade-in transition of accordion after all of the images are fully loaded.
Clicking the element(s) causes opening of the previous slide or the last one if none is active.
Specifies whether to change accordion dimensions according to its parent.
Specifies which method of scaling is applied to images with class jAccordion-img.
Active slide remains open until another one is selected.
Duration (in milliseconds) of transition (opening/closing a slide).
Specifies whether slides are stacked vertically or horizontally.
jAccordion by maniacpc, exclusively for CodeCanyon