• WEB常见问题

    1.关闭当前浏览页面:onClientClick="window.close()" 2.网页中添加计时器:(考试系统) <head runat="server"> <title></title> <script language="javascript"> var hour = 2 var minute = 0 var second = 0 function clockShow() { second = second - 1; if (second < 0) { second = 59; minute = minute - 1; } if (minute < 0) { minute = 59; hour = hour - 1; } if (second == 1) { document.form1.submit() } document.myform.myclock.value = hour + ":" + minute + ":" + second; var myTime = setTimeout("clockShow()", 1000); } </script> <style type="text/css"> #div11 { height: 40px; } </style> </head> <body onLoad="clockShow()"> <div id="div11" style="background-color: #C7BFCE; position: absolute; z-index: 1; width: 19%; height: 35px; top: 60px; right: 101px;"> <form NAME="myform" style="width: 240px; margin-left: 0px"> 计时器 <INPUT type="text" name="myclock" readonly="readonly" style="border-width: inherit; margin-left: 12px; background-color: #C7BFCE; width: 127px;" >&nbsp; </form> <form name="form1" method="post" action="http://www.baidu.com"> &nbsp; </form> </div> </body> </html> 3.。、、、、、、、、、、、、、、、、 <input type= "button " id= "agree " value= "等待时间为 " onclick= " "> <BR> </BODY> </HTML> <script type= "text/javascript "> var settime=300; var i; var showthis; document.all.agree.disabled=true; for(i=1;i <=settime;i++) { setTimeout( "update( "+i+ ") ",i*1000); } function update(num) { if(num==settime) { document.all.agree.value= "0 "; document.all.agree.disabled=false; } else { showthis=settime-num; document.all.agree.value= "等待时间为 ( "+showthis+ ")秒 "; } } </script>

    0
    102
    4KB
    2014-11-20
    10
关注 私信
上传资源赚积分or赚钱