考试系统的倒计时
2011-11-02 14:45
127 查看
<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>
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>
相关文章推荐
- 用JavaScript实现考试系统倒计时
- 菜鸟分享用javascript做的模拟考试系统的倒计时的时间
- 在线考试系统的倒计时
- B/S模式在线考试系统倒计时
- 【工作笔记】关于考试系统倒计时注意事项
- 考试系统倒计时
- 用js编写的考试系统倒计时
- 驾驶员科目一无纸化考试摸拟系统 官方
- 使用FineReport打造考试分析系统
- 基于oracle的在线考试系统的设计
- JAVAWEB项目--模拟考试系统需求(一)
- html和JavaScript考试系统
- 基于Web在线考试系统的设计与实现
- 在线考试与出题系统
- 全国计算机技术与软件专业技术资格(水平)考试【软件评测师】-考试内容总结(一)计算机系统构成及硬件基础知识
- JavaWeb项目开发案例精粹-第3章在线考试系统-004Service层
- 项目案例—高校考试座位编排系统
- ASP.NET Ajax 三层架构 考试系统实现(试卷模块,考试模块,评分模块,计时模块)
- 学生选课系统数据库SQL语句考试题
- 【考试系统运维】——管理至上