Skip to content

Instantly share code, notes, and snippets.

@kikobr
Created November 20, 2014 20:56
Show Gist options
  • Save kikobr/02fc174230c486b8edff to your computer and use it in GitHub Desktop.
Save kikobr/02fc174230c486b8edff to your computer and use it in GitHub Desktop.
jQuery Plugin Boilerplate
(function ( $ ) {
$.fn.greenify = function( options ) {
// This is the easiest way to have default options.
var settings = $.extend({
// These are the defaults.
color: "#556b2f",
backgroundColor: "white"
}, options );
// Greenify the collection based on the settings variable.
return this.css({
color: settings.color,
backgroundColor: settings.backgroundColor
});
};
}( jQuery ));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment