diff options
author | Jayaram Pai | 2014-04-16 16:46:09 +0530 |
---|---|---|
committer | Jayaram Pai | 2014-04-16 16:46:09 +0530 |
commit | 0709ab7cb9b43550d1ff98b4c71d5db19d998fca (patch) | |
tree | c30580abe8c2c132de2a4c221734b180b6a939d2 /js | |
parent | 221a51de1b21573a079ff2b195ea17193a920e06 (diff) | |
download | tbc-external-review-0709ab7cb9b43550d1ff98b4c71d5db19d998fca.tar.gz tbc-external-review-0709ab7cb9b43550d1ff98b4c71d5db19d998fca.tar.bz2 tbc-external-review-0709ab7cb9b43550d1ff98b4c71d5db19d998fca.zip |
added eligibility test
temporarly disabled item menu to fix production .csv bug
Diffstat (limited to 'js')
-rw-r--r-- | js/timer.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/timer.js b/js/timer.js new file mode 100644 index 0000000..381a113 --- /dev/null +++ b/js/timer.js @@ -0,0 +1,34 @@ +function getseconds() { + // take mins remaining (as seconds) away from total seconds remaining + return secs-Math.round(mins *60); +} +function getminutes() { + // minutes is seconds divided by 60, rounded down + mins = Math.floor(secs / 60); + return mins; +} +function Decrement() { + if (document.getElementById) { + minutes = document.getElementById("minutes"); + seconds = document.getElementById("seconds"); + // if less than a minute remaining + if (seconds < 59) { + seconds.value = secs; + } else { + minutes.innerHTML= getminutes(); + seconds.innerHTML = getseconds(); + } + secs--; + setTimeout('Decrement()',1000); + } +} +function countdown() { + setTimeout('Decrement()',1000); +} +$(document).ready(function() { + mins = parseInt($("#minutes_remaining").val()); + tmp = parseInt($("#seconds_remaining").val()); + secs = mins * 60 + tmp; + countdown(); +}); + |