Improve statistics
This commit is contained in:
parent
3ec732eb59
commit
df15efcf4d
1 changed files with 2 additions and 4 deletions
|
@ -29,7 +29,7 @@ $(function() {
|
|||
|
||||
function showStatistic(elementStatistic, amount, timeout) {
|
||||
var interval = 20;
|
||||
var intervalEnd = 1000;
|
||||
var intervalEnd = 750;
|
||||
|
||||
setTimeout(
|
||||
function count() {
|
||||
|
@ -40,13 +40,11 @@ function showStatistic(elementStatistic, amount, timeout) {
|
|||
if (value <= amount) {
|
||||
elementStatistic.text(value + 1);
|
||||
|
||||
var remainingSlowDown = 3;
|
||||
var remainingSlowDown = 6;
|
||||
var remainingInterations = amount - value;
|
||||
|
||||
if (remainingInterations < remainingSlowDown) {
|
||||
interval = (remainingSlowDown - remainingInterations) * (intervalEnd / remainingSlowDown);
|
||||
} else {
|
||||
interval += interval * 0.1;
|
||||
}
|
||||
|
||||
setTimeout(count, interval);
|
||||
|
|
Loading…
Reference in a new issue