Skip to content

Instantly share code, notes, and snippets.

@Quinten
Created June 28, 2013 07:52
Show Gist options
  • Save Quinten/5883164 to your computer and use it in GitHub Desktop.
Save Quinten/5883164 to your computer and use it in GitHub Desktop.
simple skeleton code to start a jquery plugin
(function( $ ) {
$.fn.pluginSkeleton = function ( options ) {
var settings = $.extend({
option1: "bones",
option2: "skull"
}, options );
return this.each(function() {
$( this ).addClass( settings.option2 ).addClass( settings.option1 );
});
};
}( jQuery ));
jQuery(document).ready(function () {
jQuery('div').pluginSkeleton({ option2: "flesh" });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment