Skip to content

Instantly share code, notes, and snippets.

@anasnakawa
Created November 17, 2012 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anasnakawa/4093500 to your computer and use it in GitHub Desktop.
Save anasnakawa/4093500 to your computer and use it in GitHub Desktop.
plugin events
/* fired when any tab is clicked, ui here hold clicked tab and its content
* ui['tab'] // current tab
* ui['content'] // current tab content (div)
*/
click: function(event, ui) {}
// when accordion is initialized, ui here holds a jQuery object to the whole accordion
init: function(event, ui) {}
// when tab is shown, ui here hold the same as in click event above
tabShown: function(event, ui) {}
// when tab is hidden, ui here hold the same as in click event above
tabHidden: function(event, ui) {}
// How can you bind these events ?
// 1. at plugin initialization
$('#multiAccordion').multiAccordion({
active: 'all',
click: function(event, ui) {
alert('tab is clicked!');
}
});
// 2. after initialization
$('#multiAccordion').multiAccordion('multiAccordionclick', function(){
alert('also clicked');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment