IE和Safari上的jQuery Countdown插件中断 [英] jQuery Countdown plugin break on IE and Safari

查看:147
本文介绍了IE和Safari上的jQuery Countdown插件中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jQuery Countdown插件,在一个页面上显示多个实例

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>

等...

my jquery代码使用每个函数

my jquery code use each function

$(".TimeLeft").each(function() {
        $(this).countdown({until:  new Date($(this).text()) , format: 'HMS', compact: true, 
    layout: '<span class="offerTimeStart">&nbsp;</span><span class="offerTimeContent">{hnn}</span><span class="offerTimeSep">&nbsp;</span><span class="offerTimeContent">{mnn}</span><span class="offerTimeSep">&nbsp;</span><span class="offerTimeContent">{snn}</span><span class="offerTimeEnd">&nbsp;</span>', serverSync: serverTime});
    });

所有在Firefox和Chrome中完美的工作 - 插件返回正确的小时数直到结束日期,但IE和Safari只显示Nan Nan Nan

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.

推荐答案

也许你想将DateRegex用于名为IE的那件事:

Maybe you want to use DateRegex for "that thing" called IE :

在jQuery和Internet Explorer中将字符串转换为日期?

我希望这个链接对你有所帮助。

I hope this link will be helpful for you.

我不知道Safari的解决方案,但尝试使用IE方式。

I don't know what solution about Safari, but try use IE way.

这篇关于IE和Safari上的jQuery Countdown插件中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆