50 lines
1.6 KiB
JavaScript
50 lines
1.6 KiB
JavaScript
|
// \______ \ ____ ___)// |_ _/ |_ ____ __ __ ____ | |__ _____ ___.__. ____ ____ __| _/____| |
|
||
|
// | | \ / _ \ / \ __\ \ __\/ _ \| | \_/ ___\| | \ / < | | _/ ___\/ _ \ / __ |/ __ \ |
|
||
|
// | ` ( <_> ) | \ | | | ( <_> ) | /\ \___| Y \ | Y Y \___ | \ \__( <_> ) /_/ \ ___/\|
|
||
|
// /_______ /\____/|___| /__| |__| \____/|____/ \___ >___| / |__|_| / ____| \___ >____/\____ |\___ >_
|
||
|
// \/ \/ \/ \/ \/\/ \/ \/ \/\/
|
||
|
|
||
|
|
||
|
var cn = true;
|
||
|
|
||
|
function resetColor() {
|
||
|
cn = false;
|
||
|
$('.digit').removeClass('w');
|
||
|
}
|
||
|
|
||
|
function setUp(numId) {
|
||
|
if (cn) { resetColor(); }
|
||
|
numId.html((parseInt(numId.html()) + 1) % 10);
|
||
|
}
|
||
|
|
||
|
function setDown(numId) {
|
||
|
if (cn) { resetColor(); }
|
||
|
if (numId.html() == "0") {
|
||
|
numId.html(9)
|
||
|
} else {
|
||
|
numId.html(parseInt(numId.html()) - 1);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
function send() {
|
||
|
$('#try1').val(parseInt($('#num1').html()));
|
||
|
$('#try10').val(parseInt($('#num10').html()));
|
||
|
$('#try100').val(parseInt($('#num100').html()));
|
||
|
$('form').submit()
|
||
|
}
|
||
|
|
||
|
$(document).ready(function(){
|
||
|
$("#1000up").click(function(){ setUp($('#num1000')); })
|
||
|
$("#100up").click(function(){ setUp($('#num100')); })
|
||
|
$("#10up").click(function(){ setUp($('#num10')); })
|
||
|
$("#1up").click(function(){ setUp($('#num1')); })
|
||
|
$("#1000down").click(function(){ setDown($('#num1000')); })
|
||
|
$("#100down").click(function(){ setDown($('#num100')); })
|
||
|
$("#10down").click(function(){ setDown($('#num10')); })
|
||
|
$("#1down").click(function(){ setDown($('#num1')); })
|
||
|
|
||
|
$('img').click(function(){
|
||
|
send();
|
||
|
});
|
||
|
})
|