-1

请帮我。我试图弄清楚为什么这个倒计时不起作用......

我正在使用这个网站上的这个 Jquery 脚本 http://keith-wood.name/countdown.html

我正在使用其回调选项卡中的第三个示例

我的代码:

<html>
    <head>
    <title>jQuery Countdown</title>
    <link rel="nofollow" type="text/css" href="https://justpaste.it/redirect/1ytp/http://keith-wood.name/css/jquery.countdown.css">

    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="http://keith-wood.name/js/jquery.countdown.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {

        $('#expireMessage').countdown({
            var shortly

            until: shortly,
            expiryText: '<div class="over">It\'s all over</div>'});

             $('#expireMessageStart').click(function() {
             alert("hi");  
             shortly = new Date();
             shortly.setSeconds(shortly.getSeconds() + 5.5);
             $('#expireMessage').countdown('option', {until: shortly});
          });
        });
    </script>
    </head>
    <body>
        <div id="expireMessage"></div>
        <span id="expireMessage" class="countdown"></span>&nbsp;
        <button type="button" id="expireMessageStart">Start</button>
    </body>
</html>

谁能帮我运行这个倒计时。

4

2 回答 2

0

您指向 JQuery 的链接是错误的。使用http://code.jquery.com/jquery-latest.js它为您提供最新版本...

于 2013-02-13T16:35:25.470 回答
0

除了如上所述修复您的 jQuery 路径外,在调用倒计时函数之前不久声明可能会解决您的问题

$(document).ready(function() { var 很快; ... }

于 2013-02-13T16:37:52.800 回答