Created
January 19, 2018 08:06
-
-
Save bUxEE/c600b155086f48df7172d8655218ee5f to your computer and use it in GitHub Desktop.
jquery plugin example
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.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