-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.js
More file actions
72 lines (50 loc) · 945 Bytes
/
time.js
File metadata and controls
72 lines (50 loc) · 945 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
window.onload=function(){
var next=document.getElementById("next");
var time=document.getElementById('time');
var body=document.getElementById("begin");
var x=8 , y=01;
var int=1000;
var count=10;
var links=["math_unit1.html","math_exam.html"];
next.href=links[0];
function cout(){
time.innerHTML=count+" sec";
if(count>0){
count--;
}
else{
time.style.top="90px";
time.style.right="5px";
time.style.color="black";
time.style.fontSize="20px";
body.style.display="none";
retime();
}
}
setInterval(cout,1000);
cout();
function timeout(){
next.click();
}
function retime(){
if(y==0 && x==0){
timeout();
}
if(y==00){
y=59;
x--;
}
y--;
if(y<10){
time.innerHTML=x + " : " + "0" + y;
}
else{
time.innerHTML=x + " : " + y;
}
}
if(count==0){
if(!(x==0 && y==0)){
setInterval(retime,int);
}
}//count if
}