Added/updated in: All versionsVersion 1.2.6Version 1.2Version 1.0
jAccordion offers numerous events to which you can attach custom functions (callbacks) to add even more features. Almost every callback contain special event object as an function parameter which extends the original event. Below you can find a summary of all available events with possibility to display detailed explanation and demo(s).
There are multiple ways how to attach callbacks to events.
1) Callbacks can be attached to events in configuration section of jAccordion:
<script type="text/javascript"> // Avoid conflict with other libraries jQuery(document).ready(function( $ ) { $('.accordion').jAccordion({ // Callback attached to event onReady onReady : function() { // some code }, // Callback attached to event onSlideOpened onSlideOpened : function(e) { // some code } }); }); </script>
2) Callbacks can be attached to events after initialization using API methods bind() and on():
<script type="text/javascript"> // Avoid conflict with other libraries jQuery(document).ready(function( $ ) { $('.accordion').jAccordion(); // Attach callback to event onAccordionMouseEnter $('.accordion').data('jAccordion').bind('onAccordionMouseEnter', function () { // some code }); }); </script>
There is of course possibility to remove callbacks (it doesn't matter which of the two previous methods was used to attach them) using API methods unbind() and off():
<script type="text/javascript"> // Avoid conflict with other libraries jQuery(document).ready(function( $ ) { $('.accordion').jAccordion({ onAccordionMouseEnter : function () { // some code } }); // Remove callback attached to event onAccordionMouseEnter $('.accordion').data('jAccordion').unbind('onAccordionMouseEnter'); }); </script>
Triggers after the accordion has been fully loaded.
Triggers when a slide is completely open.
Triggers when a slide starts opening.
Triggers when a slide starts closing.
Triggers when cursor enters the accordion's direct children .jAccordion-slidesWrapper.
Triggers when cursor leaves the accordion's direct children .jAccordion-slidesWrapper.
Triggers when autoplay is paused, i.e. when cursor enters accordion's direct children .jAccordion-slidesWrapper.
Triggers when autoplay is resumed, i.e. when cursor leaves accordion's direct children .jAccordion-slidesWrapper.
jAccordion by maniacpc, exclusively for CodeCanyon