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
<script> | |
var theClicker = $("#myClicker").clicker({ | |
isUpdated: function (event, data) { | |
console.log("isOneHundredOne"); | |
alert("Is " + data.myValue); | |
} | |
}); | |
theClicker.clicker({ newValue: 101 }); | |
</script> |
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
myClicker.clicker( { currentValue: 100 } ); | |
newCurrentValue = myClicker.clicker("currentValue"); | |
alert(newCurrentValue); |
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, | |
_currentValue : 0 | |
}, | |
// _create and other methods to access properties ommitted .. |
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
<script> | |
// initializing the startingValue | |
var myClicker = $("#myClicker").clicker({ startingValue: 4 }); | |
// getting the startingValue | |
alert(myClicker.clicker("startingValue")); | |
// setting the currentValue | |
myClicker.clicker("currentValue", 7); | |
// getting the currentValue |
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 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", { | |
_create: function () { | |
var startingValue = this.options.startingValue; | |
this.element.text("The starting value is " + startingValue); | |
} | |
}); | |
}(jQuery)); |
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
$("#myClicker").clicker( { | |
startingValue: 4 | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Clicker</title> | |
</head> | |
<body> | |
<div id="myClicker"> | |
</div> | |
<script src="Scripts/jquery-2.1.3.js"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Footnoter</title> | |
</head> | |
<body> | |
<p id="myParagraph"> | |
In up so discovery my middleton eagerness dejection explained. Estimating excellence ye contrasted | |
insensible as. Oh up unsatiable <span class="footnote">Unpacked reserved sir.</span> interested. | |
Present suppose in esteems indemesne colonel it to. End horrible she landlord screened stanhill. |
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
$.fn.footnote = function (options) { | |
// This is the easiest way to have default options. | |
var settings = $.extend({ | |
// These are the defaults. | |
color: "blue", | |
referencesLocation: "#references" | |
}, options); | |
// use the options |