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 553921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:39:20+00:00 2026-05-13T11:39:20+00:00

I want a jQuery countdown: It starts counting after page download finishes After counting

  • 0

I want a jQuery countdown:

  1. It starts counting after page download finishes
  2. After counting to 0 it redirects to a url

How can I do that?

  • 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-05-13T11:39:20+00:00Added an answer on May 13, 2026 at 11:39 am

    I thought I would break this up a bit and provide something that does both countdown, and redirection. After all, you may want to countdown and manipulate the DOM instead tomorrow. As such, I’ve come up with the following jQuery plugin that you can use, and study:

    // Our countdown plugin takes a callback, a duration, and an optional message
    $.fn.countdown = function (callback, duration, message) {
        // If no message is provided, we use an empty string
        message = message || "";
        // Get reference to container, and set initial content
        var container = $(this[0]).html(duration + message);
        // Get reference to the interval doing the countdown
        var countdown = setInterval(function () {
            // If seconds remain
            if (--duration) {
                // Update our container's message
                container.html(duration + message);
            // Otherwise
            } else {
                // Clear the countdown interval
                clearInterval(countdown);
                // And fire the callback passing our container as `this`
                callback.call(container);   
            }
        // Run interval every 1000ms (1 second)
        }, 1000);
    
    };
    
    // Use p.countdown as container, pass redirect, duration, and optional message
    $(".countdown").countdown(redirect, 5, "s remaining");
    
    // Function to be called after 5 seconds
    function redirect () {
        this.html("Done counting, redirecting.");
        window.location = "http://msdn.microsoft.com";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was creating a countdown timer using javascript; I can use jQuery. I want
I want to use jQuery to redirect a person arriving at this page to
I want to set GMT+5:30 as my timezone in jquery countdown. Start Time for
is there a jquery plugin for progress bar that can count down to a
What i'm trying to do is this <span>0%</span> I want jQuery to start counting
Can I use jquery to initiate a full page request instead of an asynchronous
I want to make some jQuery that shows some table rows and hides others
I'm using jQuery and countdown (jQuery plugin). I want the countdown to run for
I want jQuery slideToggle() to persist it's state. By default when the page loads
I am using jQuery 1.4. I want create the timer which starts on keyup

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.