Jquery Countdown表现异常

问题描述 投票:-1回答:2

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

我正在从本网站使用此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>

[有人可以帮我运行此倒计时吗?

jquery timer countdown
2个回答
0
投票

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


0
投票

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

$(document).ready(function(){不久...}

© www.soinside.com 2019 - 2024. All rights reserved.