JavaScript倒计时定时器在safari(苹果设备)中不工作,在chrome中工作


**在狩猎倒计时中未出现,请查看此处http://ao-demo.com/sa**
**在狩猎倒计时中没有出现,请查看此处http://ao-demo.com/sa**
**在狩猎倒计时中没有出现,请查看此处http://ao-demo.com/sa**
**在狩猎倒计时中没有出现,请查看此处http://ao-demo.com/sa**
**在狩猎倒计时中没有出现,请查看此处http://ao-demo.com/sa**
jQuery('.count_timmer.dt').each(function() {
var date_time = jQuery(this).attr('data-dt');
var current_itme = jQuery(this);
console.log(date_time);
var arr = date_time.split(/[-+ :T]/);
var countDownDate = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]);
console.log(countDownDate);
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
current_itme.find('.count.days .count_tag').html(days);
current_itme.find('.count.hurs .count_tag').html(hours);
current_itme.find('.count.min .count_tag').html(minutes);
current_itme.find('.count.sec .count_tag').html(seconds);
/* document.getElementById("demo").innerHTML = days + "d " + hours + "h "
+ minutes + "m " + seconds + "s ";*/
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
current_itme.hide();
current_itme.parents('.future_content').find('.header_btns.bid-btn').show();
}
}, 1000);
});

它在Firefox中也不起作用。我得到Invalid Date

你为什么要分开约会?CCD_ 2是完全有效的。

这似乎也让计时器为我工作。

最新更新