Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/examples/2_English_matchingWordsAndObjects/js/function.js
blob: ae78357756f99ab206b86e312df9efc2c2b58006 (plain)
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

function startTimer(){
				s=checkTime(s);					
				m=checkTime(m);
				h=checkTime(h);
				clickCounter = checkTime(clickCounter);
				document.getElementById('clickBox').innerHTML=clickCounter;
				document.getElementById('timerBox1').innerHTML=s;
				document.getElementById('timerBox2').innerHTML=m;
				document.getElementById('timerBox3').innerHTML=h;
				
}
	
	function increaseTime(){
	    if(play == 1){
			if(restart == 1){
			s = 0;
			m = 0;
			h = 0;
			}
					s++;
					if(s>60){
						m++;
						m=checkTime(m);
						document.getElementById('timerBox2').innerHTML=m;
						s = 0;
					}
					if(m>60){
						h++; 
							h=checkTime(h);
						document.getElementById('timerBox3').innerHTML=h;
					
						m=0;
						
					}				
					s=checkTime(s);					
					
					document.getElementById('timerBox1').innerHTML=s;
					t=setTimeout('increaseTime()',1000);
				}
					}
					function checkTime(timePara){
						if (timePara<10 )
						  {
						  timePara="0" + timePara;
						  }
						return timePara;
	 }