Created
May 15, 2012 13:22
-
-
Save rodaine/2701718 to your computer and use it in GitHub Desktop.
JavaScript: jQuery Plugin Boilerplate [$(selector).method()]
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
// based off Nettuts+ article by Jonathan Cutrell: | |
// "14 Reasons Why Nobody Used Your jQuery Plugin" | |
// http://goo.gl/yx8up | |
;(function($, window, undefined){ "use strict"; | |
$.fn.myPlugin = function(opts) { | |
var defaults = { | |
//plugin defaults | |
}; | |
var options = $.extend(defaults, opts || {}); | |
return this.each(function() { | |
//plugin logic | |
}); | |
}; | |
})(jQuery, window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment