-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.html
40 lines (35 loc) · 1.16 KB
/
Example.html
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
36
37
38
39
40
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>Example TinyTimer.js</title>
<meta charset="utf-8">
<script type="text/javascript" src="TinyTimer.js"></script>
</head>
<body>
<h1>Example TinyTimer.js</h1>
<div data-timer-update="update" data-timer-done="done" data-timer-finish="finish" data-timer-duration="3" data-timer-repeat="true"></div>
<div data-timer-update="update" data-timer-delay="2000" data-timer-mutation="2" data-timer-done="done" data-timer-finish="finish" data-timer-duration="12" data-timer-repeat="true"></div>
<div data-timer-duration="3" data-timer-repeat="2"></div>
<div data-timer-duration="7" data-timer-mutation="2" data-timer-repeat="2"></div>
<div data-timer-duration="7" data-timer-mutation="2" data-timer-finish="finish" data-timer-repeat="2"></div>
<script>
function done(index)
{
console.log("#"+index+" : Done");
}
function finish(index)
{
let element=document.querySelector("div.timer-"+index);
if(element)//Found
{
element.textContent="Finish!";
}
console.log("#"+index+" : Finish");
}
function update(index)
{
console.log("#"+index+" : Update");
}
</script>
</body>
</html>