Callbacks
Callbacks are a way to trigger a specific action when an event is fired
within jmpress.js. For instance if we want to fire some code before a slide
change we use the beforeChange callback:
$('#jmpress').jmpress({
'beforeChange': function( element, eventData ) {
// ...
}
});
All callbacks supply the same two parameters: element, the element the event
pertains to and eventData, various data associated with the event.
Available Callbacks
- setActive: When a step is activated or selected.
- setInactive: When a previously active step is de-activated or not
- afterInit: After all the steps are initialized.
- afterDeinit: After all the steps are de-initialized.
- beforeChange: Before each step change. eventData.cancel() cancels the select.
- beforeDeinit: Before all the steps are de-initialized.
- beforeInit: Before all the steps are initialized.
- beforeInitStep: On each step as it is initialized.
- initStep: On each step as it is initialized.
- applyStep: Called last on each step after it is initialized.
- unapplyStep: Called last on each step after is is de-initialized.
- loadStep: When a step has began loading via AJAX.
- afterStepLoaded: Called after the AJAX step has finished loading.
- selectEnd: Callback should return the last step.
- selectHome: Callback should return the first step.
- selectInitialStep: Callback should return the initial step.
- selectNext: Callback should return the next step.
- selectPrev: Callback should return the prev step.
selected.
Additionally the jQuery events "enterStep" and "leaveStep" will be fired on the step element.