问题
I'm using jQuery Countdown plugin with multiple instances on one page
<div class="TimeLeft">
<?php echo counterDate($dl['end'][0]); //YYYY, MM, DD ?>
</div>
<div class="TimeLeft">
<?php echo counterDate($dl['end'][1]); //YYYY, MM, DD ?>
</div>
and etc...
my jquery code use each function
$(".TimeLeft").each(function() {
$(this).countdown({until: new Date($(this).text()) , format: 'HMS', compact: true,
layout: '<span class="offerTimeStart"> </span><span class="offerTimeContent">{hnn}</span><span class="offerTimeSep"> </span><span class="offerTimeContent">{mnn}</span><span class="offerTimeSep"> </span><span class="offerTimeContent">{snn}</span><span class="offerTimeEnd"> </span>', serverSync: serverTime});
});
All work perfect in Firefox and Chrome - plugin return correct hours until end date but IE and Safari shows just Nan Nan Nan
I try to use different time format such a Date and Hour but no success.
回答1:
Maybe you want to use DateRegex for "that thing" called IE :
Convert string to date in jQuery and Internet Explorer?
I hope this link will be helpful for you.
I don't know what solution about Safari, but try use IE way.
来源:https://stackoverflow.com/questions/7836875/jquery-countdown-plugin-break-on-ie-and-safari