<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