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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:18:05+00:00 2026-06-10T23:18:05+00:00

I have a script: http://jsfiddle.net/bXJhe/7/ jQuery(document).ready(function() { timer(10) }); // Timer var GLOBAL_TIMER; function

  • 0

I have a script:

http://jsfiddle.net/bXJhe/7/

jQuery(document).ready(function() {

    timer(10)

});

// Timer
var GLOBAL_TIMER;

function timer(intCount) {
    GLOBAL_TIMER = setInterval(function() {

        var intTickLength = 10;

        if (intCount < 10) {
            jQuery('#timer').html('00:0' + intCount--);
            jQuery('#bar').css('width', intCount * intTickLength + 'px');
        } else {
            jQuery('#timer').html('00:' + intCount--);
            jQuery('#bar').css('width', intCount * intTickLength + 'px');
        }

        if (intCount < 0) {
          stopTimer();
        }

    }, 1000);
}

function stopTimer() {
    clearInterval(GLOBAL_TIMER);
}​

I’m animating the width of the progress bar based on the intCount * intTickLength (maybe there’s a better way?)

Problem is, when the counter reaches 1, the last tick on the bar disappears. I need it to remain until counter reaches 0. I need some kind of an offset.. Any ideas? I’m no js expert, but I long to be one.

  • 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-10T23:18:06+00:00Added an answer on June 10, 2026 at 11:18 pm

    Set the bar size before you decrement the counter:

    jQuery('#bar').css('width', intCount * intTickLength + 'px');
    jQuery('#timer').html('00:0' + intCount--);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so basically here is my script: http://jsfiddle.net/JJFap/42/ Code - jQuery(document).ready(function() { var rel =
I have following code (html,js,jquery) snippet ( http://jsfiddle.net/MUScJ/2/ ): <script type=text/javascript> function someFunc(){ html
I have a CSS/jQuery Checkbox style script: http://jsfiddle.net/BwaCD/ The problem is, in current browsers
i have this script found here http://jsfiddle.net/g4txt/ i am using this carousel http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm the
I have made small jquery collapse/expand script http://jsfiddle.net/goldie/QFL49/ (please don't pay attenton to html/css
I have a question about ultra simple jquery tabs. I use this script: http://jsfiddle.net/HX5KZ/2/
Currently I have a JQuery script in place http://jsfiddle.net/gaby/zzj7E/5/ which handles the requirement that
I have this code: http://jsfiddle.net/Q4PUw/2/ Hence, a simple HIDDEN TO VISIBLE jQuery Script. What
I have a script setup like this (http://jsfiddle.net/YD66s/): var countFull = new Array(0,1,2,3,4,5,6); var
I have this bit of jQuery script that can be found here: http://jsfiddle.net/RUqNN/45/ When

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.