Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/examples/2_English_matchingWordsAndObjects/js/function.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/2_English_matchingWordsAndObjects/js/function.js')
-rwxr-xr-xexamples/2_English_matchingWordsAndObjects/js/function.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/examples/2_English_matchingWordsAndObjects/js/function.js b/examples/2_English_matchingWordsAndObjects/js/function.js
new file mode 100755
index 0000000..ae78357
--- /dev/null
+++ b/examples/2_English_matchingWordsAndObjects/js/function.js
@@ -0,0 +1,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;
+ } \ No newline at end of file