Created
October 18, 2012 11:55
-
-
Save vladimir-s-snippets/3911349 to your computer and use it in GitHub Desktop.
JavaScript: jQuery: plugin template
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($) { | |
$.fn.<PLUGIN_NAME> = function(settings) { | |
//default values | |
var config = { | |
}; | |
//using user defined values | |
if (settings) $.extend(config, settings); | |
//single element | |
// var element = this; | |
// iterate over matched elements | |
return this.each(function() { | |
// implementations | |
}); | |
}; | |
// public functions definition | |
$.fn.pluginName.functionName = function(foo) { | |
return this; | |
}; | |
// private functions definition | |
function foobar() {} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment