Team:AUC TURKEY/Test
From 2013hs.igem.org
(Difference between revisions)
Line 9: | Line 9: | ||
</style> | </style> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | window.onload= | + | window.onload=countdownTimer(); |
+ | var jamboree=newDate(2013,5,28); | ||
var countdown=document.getElementById("countdown"); | var countdown=document.getElementById("countdown"); | ||
- | + | countdownTimer=function() | |
- | countdown.innerHTML=" | + | { |
+ | var _loc6 = new Date(); | ||
+ | var _loc2 = jamboree - _loc6; | ||
+ | if (_loc2 < 0){ | ||
+ | days = "000"; | ||
+ | hours = "00"; | ||
+ | minutes = "00"; | ||
+ | seconds = "00"; | ||
+ | }else{ | ||
+ | var _loc1 = Math.floor(_loc2 / 86400000); | ||
+ | var _loc4 = Math.floor(_loc2 / 3600000) % 24; | ||
+ | var _loc5 = Math.floor(_loc2 / 60000) % 60; | ||
+ | var _loc3 = Math.floor(_loc2 / 1000) % 60; | ||
+ | if (_loc1 < 10){ | ||
+ | days = "00" + _loc1; | ||
+ | }else if (_loc1 < 100){ | ||
+ | days = "0" + _loc1; | ||
+ | }else{ | ||
+ | days = _loc1; | ||
+ | } | ||
+ | if (_loc4 < 10){ | ||
+ | hours = "0" + _loc4; | ||
+ | }else{ | ||
+ | hours = _loc4; | ||
+ | } | ||
+ | if (_loc5 < 10){ | ||
+ | minutes = "0" + _loc5; | ||
+ | }else{ | ||
+ | minutes = _loc5; | ||
+ | } | ||
+ | if (_loc3 < 10){ | ||
+ | seconds = "0" + _loc3; | ||
+ | }else{ | ||
+ | seconds = _loc3; | ||
+ | } | ||
+ | countdown.innerHTML=days+":"+hours+":"+minutes+":"+seconds; | ||
} | } | ||
</script> | </script> |
Revision as of 12:38, 12 June 2013