slowed down ratio of listening to the event

This commit is contained in:
Senad Uka
2016-05-14 07:50:15 +02:00
parent 8c52ead52b
commit 053dc6397c

View File

@@ -1,13 +1,22 @@
var count = 0;
var pressing = false;
$(document).ready(function () {
$(document).ready(function() {
$("#tekst").bigText({
horizontalAlign: 'left'
});
$('#tekst').html(count);
$("html").keyup(function(event) {
count += 10;
if (count > 100) count = 0;
$('#tekst').html(count);
pressing = true;
setTimeout(function() {
if (pressing) {
count += 10;
if (count > 100) count = 0;
$('#tekst').html(count);
pressing = false;
}
}, 500);
})
});