JS countdown code suitable for promo-Countdown code

Source: Internet
Author: User

<div class= "Tiem_price clearfix fonts" style= "margin-top:15px;" >    <div class= "Clockcontainer clockContainer1 fl Relative" id= "38zhe" > <span class= "Day FL Timer" >00& Lt;/span><em class= "tag fl" > Days </em> <span class= "hour FL Timer" >00</span><em class= "tag FL "> Time </em> <span class=" minute fl Timer ">00</span><em class=" tag fl "> Points </em> <span class= "Second FL timer" >00</span><em class= "tag fl" > Sec </em> </div>    <div class= " Youhuiprice relative FR "> Original price: 3800 RMB/Time </div>  

 

 <script> $ ( function   () {countdown ( "2016/3/3 12:00:00", "#38zhe"  "2016/3/31 12:00:00", "#0tuo"  </script> 
JS method
function Countdown (time,id) {
var day_elem=$ (ID). Find ('. Day ');
var hour_elem=$ (ID). Find ('. hour ');
var minute_elem=$ (ID). Find ('. minute ');
var second_elem=$ (ID). Find ('. Second ');
var end_time = new Date (time). GetTime ();
var Sys_second = (end_time-new Date (). GetTime ())/1000;
var timer = setinterval (function () {
if (sys_second>1) {
Sys_second-=1;
var Day=math.floor ((sys_second/3600)/24);
var Hour=math.floor ((sys_second/3600)%24);
var Minute=math.floor ((SYS_SECOND/60)%60);
var second=math.floor (sys_second%60);
$ (Day_elem). Text (day);
$ (Hour_elem). Text (hour<10? " 0 "+hour:hour);
$ (Minute_elem). Text (minute<10? " 0 "+minute:minute);
$ (Second_elem). Text (second<10? " 0 "+second:second);
}
else {
Clearinterval (timer);
}
}, 1000);
}

JS countdown code suitable for promo-Countdown code

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.