2

我在一个网站上工作,我已经安装了 Keiths Woods 的 jQuery 倒计时。它在 Chrome 上运行良好,但在 IE、Mozilla、iPad 和 iPhone 上却无法运行。倒计时一直到 2012 年 1 月 10 日。它显示 72 天、7 小时等。在其他浏览器上,它显示NaN天数、NaN小时数等。

我有以下 HTML:

<html>
<head>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="jquery.countdown.min.js"></script>
    <script type="text/javascript" src="scripts.js"></script>
    <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="jquery.countdown.css" media="screen" />
</head>
<body>
    <div class="body">
        <div class="countdown"></div>
        <div class="logo"></div>
    </div>
</body>
</html>

里面scripts.js我有:

$(document).ready(function(){
    var date = new Date('10.1.2012'); 
    $('.countdown').countdown({until: date , format: 'DHMS'}); 
});

有什么问题jquery.countdown.min.js?我不知道该怎么做。

4

2 回答 2

3

尝试取消限制Dto d

$('.countdown').countdown({until: date , format: 'dHMS'}); 

因为在插件的主页上也是如此:

$(selector).countdown({until: liftoffTime, format: 'dHM'});

编辑:更改为以下内容,它在 Safari 中对我有用

var date = new Date(2012, 10-1, 1);

在 Chrome 以外的浏览器中,字符串的解析可能出错了。

于 2012-07-20T14:06:59.290 回答
3

检查你的日期。如果你的约会对象是前任。“02-23-2012 23:22:22”将其更改为“02/23/2012 23:22:22”

使用正斜杠,否则 iphone Mozilla 会抱怨

于 2012-08-24T04:45:10.187 回答