Skip to content

Instantly share code, notes, and snippets.

@bUxEE
Created January 19, 2018 08:06
Show Gist options
  • Save bUxEE/c600b155086f48df7172d8655218ee5f to your computer and use it in GitHub Desktop.
Save bUxEE/c600b155086f48df7172d8655218ee5f to your computer and use it in GitHub Desktop.
jquery plugin example
(function($) {
$.fn.extend({
myPlugin: function(options) {
var defaults = {
something: 23,
otherThing: 'hello'
};
options = $.extend(defaults, options);
console.log(options.something);
console.log(options.otherThing);
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment