Callbacks - Mottie/Kwicks GitHub Wiki

Demo | Playground | [Home]] ](/Mottie/Kwicks/wiki/[Setup) | [Methods]] | [Theming]] ](/Mottie/Kwicks/wiki/[[Change)


####Event Hooks (callback functions)

  • kwicks-initialized (initialized) - this event called immediately after kwicks has been initialized.
  • kwicks-init (init) - kwick event/eventClose occured, this event occurs before expanding or collapsing the kwick.
  • kwicks-expanding (expanding) - this event occurs only when the kwick is expanding. It is triggered immediately before the animation.
  • kwicks-collapsing (collapsing) - this event occurs only when the kwick is collapsing. It is triggered immediately before the animation.
  • kwicks-completed (completed) - this event occurs after the animation has completed.
  • kwicks-playing (playing) - this event occurs after kwicks has started playing.
  • kwicks-paused (paused) - this event occurs after kwicks has paused.

####Examples You can bind to any of these custom event triggers as follows (see the demo page source for another example)

$('#kwicks').bind('kwicks-completed', function(e, kwicks){
  alert( 'kwick has completed opening panel #' + kwicks.active );
});

or use on of the callback functions

$('#kwicks').kwicks({
  completed: function(kwicks){
    alert('Done! panel #' + kwicks.active + ' is open'); 
  }
});

or use a shortcut method callback

$('#kwicks').kwicks(1, function(kwicks){
  alert('now on panel #' + kwicks.active);
});

####Callback Arguments If you use "kwicks" in the callback function, e.g. function(kwicks){...}, or in the trigger function, e.g. function(e, kwicks){...} these arguments will be available

  • kwicks.active - index of the active quick (zero based index).

  • kwicks.$active - jQuery object of the active quick (the 'li.active').

  • kwicks.lastActive - index of the last active quick.

  • kwicks.$kwicks - jQuery object containing all kwicks (all the li's).

  • kwicks.$el - jQuery object of the entire kwick (the ul).

  • kwicks.playing - true when the slideshow is playing.

  • kwicks.play(#) - start the slideshow, # is the panel number to start on (optional)

  • kwicks.pause() - pause the slideshow