Similar e-commerce countdown code

Source: Internet
Author: User

<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<meta name= "Apple-mobile-web-app-title" content= "" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta name= "format-detection" content= "Telephone=no" >
<meta name= "viewport" content= "Width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=yes, Minimal-ui ">
<title>test</title>
<script src= "Js/jquery-2.0.0.min.js" type= "Text/javascript" charset= "Utf-8" ></script>
<script type= "Text/javascript" >
var status = 1;
</script>
<body>
<p id= "countmsg" > Distance:
<b id= "T_d" >00 Day </b>
<b id= "T_h" >00 </b>
<b id= "T_m" >00 points </b>
<b id= "t_s" >00 sec </b>
</p>
<script type= "Text/javascript" >
function Getrtime () {
var endtime= new Date (' 2016/1/15 13:47:19 '); Cut-off time
var nowtime = new Date ();

var t =endtime.gettime ()-nowtime.gettime ();

var d=-(Math.floor (T/1000/60/60/24));
var h=-(Math.floor (t/1000/60/60%24));
var m=-(Math.floor (t/1000/60%60));
var s=-(Math.floor (t/1000%60));
Console.log ("d=" + (-D) + "h=" + (-H) + "m=" + (-m) + "s=" + (-s));
document.getElementById ("T_d"). InnerHTML = d + "Day";
document.getElementById ("T_h"). InnerHTML = h + "when";
document.getElementById ("T_m"). InnerHTML = m + "min";
document.getElementById ("t_s"). InnerHTML = s + "s";
if (d = = 0 && h ==0 && m ==0 && s = = 0) {
document.getElementById ("T_d"). InnerHTML = 0;
document.getElementById ("T_h"). InnerHTML = 0;
document.getElementById ("T_m"). InnerHTML = 0;
document.getElementById ("t_s"). InnerHTML = 0;


Alert ("Skip Live Room")
}
}
SetInterval (getrtime,1000);

</script>

</body>

Similar e-commerce countdown code

Related Article

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.