Domanda

I'm using an admittedly slightly older version of keith wood's countdown, and it's loading the correct date and time just fine, but the seconds aren't ticking down. I've inspected the js with console, and no errors are coming up. Can any tell me what's amiss?

    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/jquery.countdown.js"></script>
<script type="text/javascript" src="/js/jquery.plugin.js"></script>
    </head>

    <div id="form">
        <div id="topbox">
            <div class="countdown"></div>
        </div>
    </div>

    $(document).ready(function() {

        // start instance of countdown
        $('.countdown').countdown({until: new Date(2014, 9-1, 21, 10), layout: 
            '<ul class="countdown-tabs"><li><a>{dn} <span>{dl}</span></a></li>' + 
            '<li><a>{hn} <span>{hl}</span></a></li>' + 
            '<li><a>{mn} <span>{ml}</span></a></li>' + 
            '<li class="last-child"><a>{sn} <span>{sl}</span></a></li></ul>'});

        $('.bg-switcher input').change(function () {
            // set background photo to value of photo-switcher
            window.location.hash = $(this).attr('id');
            var photo = "url('/images/countdown_" + $(this).attr('id') + ".jpg')";
            $('#canvas').css('background-image', photo);
        });

    });

I've also set it up on jfiddle, here: http://jsfiddle.net/Abk99/2/

È stato utile?

Soluzione

I included this countdown script from a cdn and it's working.

//cdnjs.cloudflare.com/ajax/libs/jquery-countdown/1.6.3/jquery.countdown.min.js

http://jsfiddle.net/Abk99/1/

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top