Skip to content

Instantly share code, notes, and snippets.

@devdays
Created February 23, 2015 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/11c09ef70fc9b736ed23 to your computer and use it in GitHub Desktop.
Save devdays/11c09ef70fc9b736ed23 to your computer and use it in GitHub Desktop.
jQuery widget create with default options values
(function ($) {
$.widget("custom.clicker", {
// Default options.
options: {
startingValue: 0
},
_create: function () {
var startingValue = this.options.startingValue;
this.element.text("The starting value is " + startingValue);
}
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment