Created
May 7, 2012 13:41
-
-
Save james2doyle/2627835 to your computer and use it in GitHub Desktop.
jQuery plugin boilerplate for building proper jQuery plugins
This file contains 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
(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