Archived
1
0
This repository has been archived on 2020-12-10. You can view files and clone it, but cannot push or open issues or pull requests.
old/assets/js/donate.js
2018-10-16 18:28:42 +02:00

16 lines
537 B
JavaScript

$('#donationvalue').on('input change', function() {
var vals = [1, 2, 5, 10, 15, 20, 25, 30, 50, 100];
var val = $('#donationvalue').val();
var rval = parseInt(val, 10) + 1;
$('#donationoutput').text(vals[val]);
$('#donationicons span').removeClass('selected');
$('#donationicons span:nth-of-type(' + rval + ')').addClass('selected');
});
$('#donationicons span').click(function() {
var val = $('#donationicons span').index(this) / 2;
$('#donationvalue').val(val);
$('#donationvalue').change();
});