Page 445 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 445
$("#newGameButton").on("click", function() {
location.reload();
});
});
$("#newGameButton").hide();
$("#startButton").on("click", function() {
if (textBoxIsValid) {
var bet = $("#placeBetTextBox").val();
game.shuffleCups(bet);
gamestate=2;
console.log(gamestate);
$("#betMenuDiv").toggle("slide");
} else {
$("#placeBetTextBox").val("");
$("#placeBetTextBox").attr("placeholder", "Place valid bet!");
}
});
$("#placeBetTextBox").on("change", function () {
textBoxIsValid = false;
if (!isNaN(this.value)) {
if (this.value > game.CashInBank || this.value < 1) {
$("#placeBetTextBox").css({
"border": "1px solid red",
"color": "red"
});
} else {
$("#placeBetTextBox").css({
"border": "1px solid white",
"color": "white"
});
textBoxIsValid = true;
}
} else {
$("#placeBetTextBox").css({
"border": "1px solid red",
"color": "red"
});
}
});
$("#okFromSuccess").on("click", function() {
- 438 -