JS test System time Countdown effect code

Source: Internet
Author: User
Tip: You can modify some of the code before running

<ptml xmlns= "http://www.w3.org/1999/xhtml" > <pead> <title> Untitled page </title> <meta http-e quiv= "Content-type" content= "text/html; charset=gb2312 "/> </pead> <body onload= ' changetime (); Scall (); ' > <form id= "Form1" > <!--analog page width height--> <div align= "center" > <center> <table width= "770" hei ght= "3000" border= "0" cellpadding= "0" cellspacing= "0" bgcolor= "#F4F4F4" > <tr> <td width= "100%" valign= "top "></td> </tr> </table> </center> </div> <!--pop-up time hint--> <div id=" JAVASCRIPT.R Ightdiv "> <div id=" timeshow "></div> </div> <script language=" JavaScript ">//Pop-up div var Showad = true; var toppx = 10; Upper position var addivw = 200; width var addivh = 25; Height var pagewidth = 750; The page how many width pixel just does not appear right and left scroll bar var minscreenw = 1000; Minimum screen width pixel function scall () {if (!showad) {return;} var borderpx = ((window.screen.width-pagewidth)/2-ADDIVW)/2; document.getElementById ("Javascript.rightdiv"). style.display= ""; document.getElementById ("Javascript.rightdiv"). style.top=document.body.scrolltop+toppx; document.getElementById ("Javascript.rightdiv"). style.left=document.body.scrollleft+ Document.body.clientwidth-document.getelementbyid ("Javascript.rightdiv"). Offsetwidth-borderpx; } Window.onscroll=scall; Window.onresize=scall; Online exam time tips var h=1; Set the test time (hour unit) var m=0.1; Set test time (minutes unit) var timeshowid= "Timeshow"; Set time display layer ID var timenum=h*60*60+m*60; var timestr; function Changetime () {timenum--; if (Timenum > 0) {timestr=settimeout ("changetime ()", 1000); if (timenum<300) {alert (' 5 minutes left before the system autocommit time, prepare for submission as soon as possible '); if (timenum<30) {alert (' 30 seconds left before the system automatic submission time, please submit it immediately '); } else {//system submission Complete} document.getElementById (Timeshowid). Innerhtml= "System hint: your time is left. ; span > "+math.floor" (TimenuM/60) + "min" +timenum%60+ "sec </span>"; } </SCRIPT> </form> </body > </ptml></td> </tr> </table>
Tip: You can modify some of the code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.