Use jquery to achieve the countdown effect, which is to display the effect on the page for a few hours and a few seconds.
Refer to the latest Jquery.js file in the header:
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<script src= "Jquery.js" type= "Text/javascript" ></script>
Front page:
<body>
<div id= "Remainseconds" style= "Display:none" >180000</div>
<div id= "Remaintime" style= "Font-size:20px;font-weight:800;color: #FF9900" ></div>
</body>
jquery Code:
<script type= "Text/javascript" language= "JavaScript" >
var Syssecond;
var intervalobj;
$ (document). Ready (function () {
Syssecond = parseint ($ ("#remainSeconds"). html ());
Intervalobj = Window.setinterval (setremaintime, 1000);
});
function Setremaintime () {
if (Syssecond > 0) {
Syssecond = SysSecond-1;
var second = Math.floor (syssecond% 60);
var minite = Math.floor ((SYSSECOND/60)% 60);
var hour = Math.floor ((syssecond/3600)% 24);
var day = Math.floor ((syssecond/3600)/24);
$ ("#remainTime"). HTML (day + "days" + Hour + "hours" + minite + "Minutes" + second + "seconds");
} else {
Window.clearinterval (Intervalobj);
}
}
</script>