<script type="text/javascript">
var times = ${exame.limiteTime * 60};//将分钟换算成秒
function setTimers() {
hours = Math.floor(times / 3600);
minutes = Math.floor(times / 60 % 60);
seconds = Math.floor(times % 60);
if (times > 0) {
msg = "离考试结束还有" + hours + "时" + minutes + "分" + seconds + "秒";
document.getElementById("timerColorIds").innerHTML = msg;
if (times < 1 * 60) {
document.getElementById("timerColorIds").className = "timercolor";//重新为该区域的显示信息赋新的css样式
if (times == 0) {
alert("考试结束");
document.myform.submit();
}
}
--times;
}
}
//倒计时的定时器
var timer2 = setInterval("setTimers()", 1000);
</script>
<html>
<div id="timerColorIds"
style="right: 0px, bottom : 1px; margin-top: 200px">
</div>
</html>