Created
November 20, 2014 20:56
-
-
Save kikobr/02fc174230c486b8edff to your computer and use it in GitHub Desktop.
jQuery Plugin Boilerplate
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.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