Skip to content

Instantly share code, notes, and snippets.

@philchristensen
Created April 20, 2012 15:12
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 philchristensen/2429505 to your computer and use it in GitHub Desktop.
Save philchristensen/2429505 to your computer and use it in GitHub Desktop.
jQuery Plugin Stub
(function($) {
var settings;
var methods = {
init: function(options){
// Create some defaults, extending them with any options that were provided
settings = $.extend({
}, options);
return this
},
};
$.fn.mediaTextfield = function(method){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if(typeof method === 'object' || !method){
return methods.init.apply(this, arguments);
}
else{
$.error('Method ' + method + ' does not exist.');
}
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment