http://docs.jquery.com/Plugins/Authoring#Defaults_and_Options describes how a plugin could have default options.
var settings = $.extend( {
'location' : 'top',
'background-color' : 'blue'
}, options);
The second part of the selected answer jQuery Plugin: Adding Callback functionality describes how to add a callback in the option object.
// extend the options from pre-defined values:
var options = $.extend({
callback: function() {}
}, arguments[0] || {});
// call the callback and apply the scope:
options.callback.call(this);
How would I add both default settings and a callback function at the same time? Also, I am a little confused on why I would extend the default callback function against arguments[0] or an empty object. Thanks
simply merge both, you can have as many items in a object as you want
user_options || {}makes sure that if user hasn’t provided any options we use empty options object