Skip to content

Instantly share code, notes, and snippets.

@StevenBlack
Created April 6, 2010 22:41
Show Gist options
  • Save StevenBlack/358216 to your computer and use it in GitHub Desktop.
Save StevenBlack/358216 to your computer and use it in GitHub Desktop.
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