Countdown Timer Improvements

Details of modifications which users can incorporate within Enuuk Auction Platform free of charge
Post Reply
RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Countdown Timer Improvements

Post by RWAP » Mon May 31, 2010 6:13 pm

A couple of simple improvements here...

1) We came across a minor bug where the countdown timer was out by 30 days on 31st May 2010 - this si fixed by downloading the latest version of jQuery.countdown and uploading it to themes..\js\countdown\
The latest version can be downloaded from http://keith-wood.name/countdown.html

2) Use the minified version in the themes\default\header.php - this is quicker to download, as it is shorter.

Find:

Code: Select all

    <script type="text/javascript" src="<?=$relativePath?>themes/<?=$theme?>/js/countdown/jquery.countdown.js"></script>
Change this to:

Code: Select all

    <script type="text/javascript" src="<?=$relativePath?>themes/<?=$theme?>/js/countdown/jquery.countdown.min.js"></script>
3) when the countdown timer reaches zero, why not reload the page, rather than it showing 0 hours 0 minutes 0 seconds left.
To do this, edit themes\...\js\global.js

Find:

Code: Select all

    // Countdown
    $('span.countdown').each( function() {
        var $t = $(this);
        var oDate = $t.find('input').val();
        $t.countdown({until:oDate})
    });
Change this to:

Code: Select all

    // Countdown
    $('span.countdown').each( function() {
        var $t = $(this);
        var oDate = $t.find('input').val();
        $t.countdown({until:oDate,onExpiry:reloadPage})
    });
Then, at the end of the file, add:

Code: Select all

function reloadPage()
{
    location.reload();
}

RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Countdown Timer Improvements

Post by RWAP » Wed Jun 23, 2010 8:41 pm

This is now all implemented in v2.2 of Enuuk, apart from the use of the minified version of the countdown code.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests