Instantly share code, notes, and snippets.

Embed
What would you like to do?
Skeleton jQuery plugin
// Skeleton jQuery plugin
function($)
{
$.fn.myPlugin = function( options )
{
// options.
$.fn.myPlugin.settings = $.extend( {}, $.fn.myPlugin.defaults, options );
// Go through the matched elements and return the jQuery object.
return this.each( function() {
});
};
// Public defaults and settings.
$.fn.myPlugin.defaults = {
prop: 'some value'
};
$.fn.myPlugin.settings = { };
// Private functions.
function myFunc()
{
return;
};
// Public functions.
$.fn.myPlugin.func = function()
{
return;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment