Skip to content

Instantly share code, notes, and snippets.

@halfzebra
Last active August 29, 2015 13:59
Show Gist options
  • Save halfzebra/10754566 to your computer and use it in GitHub Desktop.
Save halfzebra/10754566 to your computer and use it in GitHub Desktop.
$.fn.tooltip = function( method ) {
// decide what to do next...
// if we have a methods[method] then let's try to invoke it
if ( methods[method] ) {
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
// this is an object so we should try to pass it as options
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
$.error( method + ' is not available' );
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment