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 count = 0;
|
||||||
|
var pressing = false;
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
$("#tekst").bigText({
|
$("#tekst").bigText({
|
||||||
horizontalAlign: 'left'
|
horizontalAlign: 'left'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#tekst').html(count);
|
||||||
|
|
||||||
$("html").keyup(function(event) {
|
$("html").keyup(function(event) {
|
||||||
count += 10;
|
pressing = true;
|
||||||
if (count > 100) count = 0;
|
setTimeout(function() {
|
||||||
$('#tekst').html(count);
|
if (pressing) {
|
||||||
|
count += 10;
|
||||||
|
if (count > 100) count = 0;
|
||||||
|
$('#tekst').html(count);
|
||||||
|
pressing = false;
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user