111,126
社区成员
发帖
与我相关
我的任务
分享<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>无标题页</title>
<script type="text/javascript">
var TimeID=null;
var Record=false;
var maxtime = 63*5; //一个小时,按秒计算,自己调整!
function Submit(){
document.getElementById('bgsound').play();
alert('时间已到,提交成功!');}
function CountDown(){
if(maxtime>=0){
minutes = Math.floor(maxtime/60);
seconds = Math.floor(maxtime%60);
msg = ""+minutes+"分"+seconds+"秒";
document.all["timer"].innerHTML=msg;
if(maxtime == 5*60) alert('注意,还有5分钟!');
--maxtime;
}
else{
clearInterval(timer);
Submit();
}
}
timer = setInterval("CountDown()",1000);
</script>
</head>
<body onload="CountDown()">
<form id="form1" runat="server" onclick="Submit();">
<embed id="bgsound" loop="0" autostart="false" style="display:none" src="http://www.lingshengzhan.com/shiting/温柔闹钟提示音.mp3 "></embed>
<div name="divTestInfo" id="divTestInfo" style="bottom: auto;border:solid 0px #000;left:200px;width:180px;height:80px">
<table width="100%" height="50" align="center" border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="1">
<tr>
<td colspan="2" align="center" bgcolor="#0000ff"> <font color="#FFFFFF"> <strong>控制面板 </strong> </font> </td>
</tr>
<tr>
<td align="right" bgcolor="#0000ff" style="width: 100px; height: 20px"> <font color="#FFFFFF">考试总时间: </font> </td>
<td bgcolor="0000ff" align="right" style="width: 77px; height: 20px"> <font color="#DDFF00"> <strong> 60</strong> </font> <font color="#FFFFFF">分钟 </font>
</td>
</tr>
<tr>
<td align="right" bgcolor="#0000ff"style="width: 100px; height: 20px;"> <font color="#FFFFFF">剩余时间: </font> </td>
<td bgcolor="#0000ff" align="right" style="width: 77px; height: 20px;"> <font color="#DDFF00"> <div id="timer"></div>
</td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#0000ff" style="height: 30px">
<input id="button1" name="button1" type="Submit" value="交卷"/> </td>
</tr>
</table>
</div>
</form>
</body>
</html>