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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:02:30+00:00 2026-06-01T00:02:30+00:00

I am trying to build a progression bar that is linked with a timer.

  • 0

I am trying to build a progression bar that is linked with a timer. For instance each second will add 1% to the width of the bar.
For now I am getting to the part where I can click a button and it start progressing, but this is purely arbitrary. How can I get some kind of infinite loop with jQuery to update the bar after each second?
Another question maybe more basic? How can I use the button to stop the progression of the bar?

Two questions

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Fancy Timer </title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <script type="text/javascript" src="javascript/jquery-1.7.2.js"></script>  
</head>



<body>


<script type="text/javascript">
$(document).ready( function ( $ ) {
    last=$('ul.events li:last div').css('border', '1px solid red');


    function foo(e) {
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
        setTimeout(function() {last.animate({"width":"+=5%"})} , 1000); // delays 1.5 sec
    };

    $("#timer").bind({
      'click': foo,
    });




})


</script>


<div id="wrapper">
<a href="#" id="timer">START</a>

    <ul class="events">
        <!-- <li style="width: 42.48%; left: 57.2%;">Design &amp; Typography <em>(2007 - 2009)</em></li> -->
        <li><div class="bar" style="width: 30%; left: 0;">Drawing &amp; Illustration <em>(2003 - 2009)</em></div> </li>
        <li><div class="bar" style="width: 55%; left: 0;">Drawing &amp; Illustration <em>(2003 - 2009)</em></div></li>
        <li><div class="bar" style="width: 45%; left: 0;">Drawing &amp; Illustration <em>(2003 - 2009)</em></div></li>
        <li><div class="bar" style="width: 10%; left: 0;">Drawing </div></li>
    </ul> <!-- end .events -->
</div>



</body>
</html>
  • 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-01T00:02:32+00:00Added an answer on June 1, 2026 at 12:02 am

    Sounds like you’re looking for setInterval.

    var timerId = setInterval(function() {
        // code you want to execute every second here
    }, 1000);
    // 1 second = 1000 milliseconds.
    

    Then when you no longer want the code to run every second, you can do:

    clearInterval(timerId);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying build a regex that will replace any characters not of the format:
Trying to build a plugin effect that will some what look better than this
Im trying to build a script that attaches and positions an instance of a
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
im trying to build a form+attachment that needs to be send to email. Im
Trying to build a dynamic gallery that is loaded via AJAX. I'm trying to
Im trying to build a form that calculates a total price based on a
Im trying to build a addin that can take some a selection of cells
im trying to build a application or a method that goes through all of
I trying to build an application that is using the torrent technology to make

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.