Created
January 18, 2011 23:34
-
-
Save emjayess/785384 to your computer and use it in GitHub Desktop.
boilerplate js for jquery plugin authoring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// replace 'foo' with the name of the plugin, etc | |
(function($){ | |
$.fn.foo = function(opts) { | |
var settings = $.extend({}, $.fn.foo.defaults, opts); | |
return this.each(function() { | |
var $this = $(this); | |
// plugin code here... | |
}); | |
}; | |
$.fn.foo.defaults = { | |
bar : "baz" | |
}; | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and now there's a website dedicated to jquery [plugin] boilerplate code!