-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscore.php
More file actions
35 lines (31 loc) · 696 Bytes
/
score.php
File metadata and controls
35 lines (31 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE>
<html>
<head>
<script>
function animateValue(id, start, end, duration) {
var range = end - start;
var current = start;
var increment = end > start? 1 : -1;
var stepTime = Math.abs(Math.floor(duration / range));
//var obj = document.getElementById(id);
var timer = setInterval(function() {
current += increment;
document.getElementById(id).innerHTML = current;
if (current == end) {
clearInterval(timer);
}
}, stepTime);
}
animateValue("value", 0, 60, 2000);
</script>
</head>
<body>
<center>
<div>
<span>Your Score is</span>
<br/><br/>
<div id="value">0</div>
</div>
</center>
</body>
</html>