Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:02:28+00:00 2026-06-13T14:02:28+00:00

1. Daily Countdown I’m trying to use Keith Wood’s jQuery countdown plugin (http://keith-wood.name/countdownRef.html) in

  • 0

1. Daily Countdown

I’m trying to use Keith Wood’s jQuery countdown plugin (http://keith-wood.name/countdownRef.html) in order to create a page of daily countdowns. E.g.:

  • A – counts down to 07:00 each day
  • B – counts down to 09:00 each day
  • C – counts down to 11:00 each day

I’m doing in a fairly hacky way:

var foo = new Date();
foo.setHours(11)
foo.setMinutes(0)
foo.setSeconds(0)
$('#fooCountdown').countdown({until: foo});

Basically, I just create a new Date object which defaults to now, then set the time to the time I want for today.

However, this is pretty hacky, and also it doesn’t reset at the end of the day – once the new day ticks over, it’s still counting down to the time on the previous day.

Is there a cleaner or better way of doing daily countdowns with this plugin?

2. Secondary Countdown

Secondly – I also want each countdown, when it expires, to count down to a second later time that day.

E.g. for A – once it reaches 07:00, it then starts counting down to 15:00 for that day.

I’m doing this using the onExpiry function:

$('#officeCountdown').countdown({until: officeOpens, onExpiry: OfficeOpen, alwaysExpire: true});

...

function OfficeOpen() {
    $('#officeCountdown').countdown('option', {until: officeCloses, onExpiry: OfficeClose, alwaysExpire: true});
}

function OfficeClose() {
    alert('Office has closed')
}

The first part – counting down down until officeOpen seems to work.

However, the second part – counting down until OfficeClose doesn’t – it seems to always start counting down the difference between officeOpens and officeCloses, instead of using the current time – and also, the function OfficeCLose never seems to trigger.

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:02:30+00:00Added an answer on June 13, 2026 at 2:02 pm

    I would suggest you use the excellent Datejs plugin for creating/handling dates.
    (read the getting-started and the docs because it is really extensive)

    This way you could do

    $('#fooCountdownA').countdown({
        until: Date.today.set({hour:7}) 
    });
    $('#fooCountdownB').countdown({
        until: Date.today.set({hour:9}) 
    });
    $('#fooCountdownC').countdown({
        until: Date.today.set({hour:11}) 
    });
    

    As for the countdown, the plugin does not seem to be friendly to re-using countdowns..
    Perhaps you are better off creating dummy elements and inserting them in the dom to hold the countdown, and destroying them on expiry..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Script: http://keith-wood.name/countdown.htm Daily json response: items: { fajr: '5:23 am', sharooq: '7:23 am', dhur:
I love LINQPad and use it daily. I have been trying to find a
As I use Notepad++ daily at work, I want to extend it to be
On a daily basis I: use multiple workstations running either Linux, Windows, or MacOS
Hard-to-read-line @daily export sunshine=~/logs/Sunshine-`date '+\%F'` && export sunshineUrl=http://www.sunshine.net/main/search_results.asp?currency_id=1&min_price=&max_price=50000&country_id=241&region_id=&Submit=Search && mkdir -p $sunshine && cd
In our daily work we maintain some rather large Javascript libaries. We use VS2008
I use Firefox in daily use. While testing own web-application in Internet Explorer, I've
I want to take daily backup of my DB for that I use following
Background: Having given up on the practical daily use of XSLT as a part
Within my daily work, I have got to maximize a particular function making use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.