Skip to content

Instantly share code, notes, and snippets.

@chrisblackwell
Created May 19, 2012 15:19
Show Gist options
  • Save chrisblackwell/2731193 to your computer and use it in GitHub Desktop.
Save chrisblackwell/2731193 to your computer and use it in GitHub Desktop.
Blank jQuery Plugin
(function($, window, undefined){
$.fn.myPlugin = function(opts) {
var defaults = {
// setting your default values for options
}
// extend the options from defaults with user's options
var options = $.extend(defaults, opts || {});
return this.each(function(){ // jQuery chainability
// do plugin stuff
});
})(jQuery, window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment