--- title: Callbacks Demo subTitle: Callbacks nav: demos description: Callback usage demo sort: 9 tags: - demo ---

Callbacks

onSliderLoad
Executes immediately after the slider is fully loaded
{{#markdown }}
default: function(){return true}
options: function(el, currentIndex){ // your codehere }
arguments:
  currentIndex: element index of the current slide
{{/markdown }}
onSlideBefore
Executes immediately before each slide transition.
{{#markdown }} ``` default: function(){return true} options: function(el, $slideElement, oldIndex, newIndex){ // your codehere } arguments: $slideElement: jQuery element of the destination element oldIndex: element index of the previous slide (before the transition) newIndex: element index of the destination slide (after the transition) ``` {{/markdown }}
onSlideAfter
Executes immediately after each slide transition. Function argument is the current slide element (when transition completes).
{{#markdown }} ``` default: function(){return true} options: function(el, $slideElement, oldIndex, newIndex){ // your codehere } arguments: $slideElement: jQuery element of the destination element oldIndex: element index of the previous slide (before the transition) newIndex: element index of the destination slide (after the transition) ``` {{/markdown }}
onSlideNext
Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element.
{{#markdown }} ``` default: function(){return true} options: function(el, $slideElement, oldIndex, newIndex){ // your codehere } arguments: $slideElement: jQuery element of the destination element oldIndex: element index of the previous slide (before the transition) newIndex: element index of the destination slide (after the transition) ``` {{/markdown }}
onSlidePrev
Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element.
{{#markdown }} ``` default: function(){return true} options: function(el, $slideElement, oldIndex, newIndex){ // your codehere } arguments: $slideElement: jQuery element of the destination element oldIndex: element index of the previous slide (before the transition) newIndex: element index of the destination slide (after the transition) ``` {{/markdown }}