在让jquery进入工作的最后倒计时时遇到问题

Having trouble getting jquery-final-countdown to work

本文关键字:倒计时 遇到 问题 最后 jquery 工作 在让      更新时间:2023-09-26

我想在我的网站上实现一个现代的倒计时计时器,我发现这个计时器工作得很好,但从Github下载后,我很难让它工作!我做错了什么?

https://github.com/PragmaticMates/jquery-final-countdown

这是他们GitHub的链接,我下载了"demo"文件夹并打开了两个html文件,但倒计时不会刚刚开始!

以下是我的结果:http://infntest.altervista.org/countdown/data-attributes.html

这是教程,它有完整的代码:http://goo.gl/D4a9c9

我的head标签:

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/demo.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-countdown/2.0.1/jquery.countdown.min.js"></script>

您的jquery-countdown.js文件指向错误的位置。具体来说,更改此部分:

<script type="text/javascript" src="../jquery.final-countdown.js"></script>

以下是运行所需的所有Javascript库:(不包括css)

<script src="//code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/kineticjs/5.2.0/kinetic.min.js"></script>
<script src="//final-countdown.pragmaticmates.com/jquery.final-countdown.js"></script>

工作演示

源代码

您似乎没有使用相同的调用签名。

他们的例子是:

$(document).ready(function() {
        $('.countdown').final_countdown({
                'start': 1362139200,
                'end': 1388461320,
                'now': 1387461319
        }, function() {
                // Finish Callback
        });
});

注意完成回调