Work on piggy banks [skip ci]

This commit is contained in:
James Cole
2014-07-31 22:01:52 +02:00
parent 50cfcb8905
commit 706d853b04
12 changed files with 394 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
$(function () {
$('input[type="range"]').on('input',inputAmount);
$('input[type="range"]').on('change',changeAmount);
});
function inputAmount(e) {
var target = $(e.target);
var piggyBankId = target.attr('name').substring(6);
var value = target.val();
valueFormatted = '€ ' + (Math.round(value * 100) / 100).toFixed(2);;
console.log(piggyBankId + ': ' + value);
var valueId = 'piggy_'+piggyBankId+'_amount';
$('#' + valueId).text(valueFormatted);
return true;
}
function changeAmount(e) {
console.log('Change!');
}