Created
February 23, 2015 19:35
-
-
Save devdays/11c09ef70fc9b736ed23 to your computer and use it in GitHub Desktop.
jQuery widget create with default options values
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 ($) { | |
$.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