slowed down ratio of listening to the event
This commit is contained in:
17
js/main.js
17
js/main.js
@@ -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);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user