Created
June 28, 2013 07:52
-
-
Save Quinten/5883164 to your computer and use it in GitHub Desktop.
simple skeleton code to start a jquery plugin
This file contains hidden or 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.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