Skip to content

Instantly share code, notes, and snippets.

@mosluce
Forked from matt0224/回呼
Last active May 3, 2017 14:20
Show Gist options
  • Save mosluce/75ba474cd65dd3a6bd3fbab3753c48eb to your computer and use it in GitHub Desktop.
Save mosluce/75ba474cd65dd3a6bd3fbab3753c48eb to your computer and use it in GitHub Desktop.
var Home = {
Box: function () {
this.color = 'black';
this.paint = function (value, cb) {
// delay 3 seconds.
//var now = new Date().getTime();
//while (new Date().getTime() < now + 3000) {
// /* do nothing */
//}
this.color = value;
cb();
}
}
}
function Button1_onclick() {
var objBox = new Home.Box();
objBox.paint("RoyalBlue", function () {
txt2.value = objBox.color;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment