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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:44:05+00:00 2026-06-11T19:44:05+00:00

I have multi-player game with a 30 second timer at the bottom of the

  • 0

I have multi-player game with a 30 second timer at the bottom of the screen.
If none of the players make a move for 30 seconds, the form submits.

var ProgressValue = 0;
function showProgress() {
    ProgressValue += 100/30;
    if (ProgressValue > 100) {
        $('form').submit();
    }
    // Ajax is done here to see if anyone has made a move.
    $('.progress .bar').css('width',ProgressValue + '%');
    setTimeout(showProgress, 1000);
}

setTimeout(showProgress, 1000);

Each second, I check the Application scope to see if anyone has changed the value of

Application.LastMove

I want the progress bar to animate smoothly, but I don’t want to do it by reducing the timeout value. I think that checking to see if anyone has taken a move every second is enough load on the server already.

I’ve heard of WebSockets, but my current server is on ColdFusion 8, so (I think) I’m satisfied with doing an ajax call every second, unless you feel that ajax is not as elegant and from a less civilized age.

Q: How do you animate a twitter-bootstrap progress bar smoothly from 3.3% to 6.6%?

  • 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-11T19:44:07+00:00Added an answer on June 11, 2026 at 7:44 pm

    Don’t animate using jQuery, prefer CSS animation, unless you have to support old browsers.

    I’ve made this copying from Bootstrap style:

    .bar {
      -webkit-transition: width 30.0s ease !important;
         -moz-transition: width 30.0s ease !important;
           -o-transition: width 30.0s ease !important;
              transition: width 30.0s ease !important;
    }
    

    For so long transition, I suggest you to try different animations: http://www.the-art-of-web.com/css/timing-function/

    In my example I’ve added two things that could be usefull:

    1. Button text changes when the animation starts and when it ends (just to check animation timings)
    2. Check if the browser support this animation: you can use your jQuery code as fallback mode

    For more information about how to detect CSS animation support: https://developer.mozilla.org/en-US/docs/CSS/CSS_animations/Detecting_CSS_animation_support

    Example: http://jsfiddle.net/CUbgr/5/

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

Sidebar

Related Questions

I have an air application that I'd like to turn into a multi-player game.
I have a project to create a multi-player monopoly game I have a pretty
I am trying to make a multi-player network game. Each player is represented by
I have a multi-step order form built in this manner: Step 1: Choose category
im developing a multi-player card game that needs the clients to communicate with each
I'm about to release a MMORPG. In my game, every 1 second, each player
I'm developing a multi-player game in Python with a Flask frontend, and I'm using
I've been thinking about a multi player RTS game. The part that I can't
I have the following scenario: Game has GameUID, GameName Player has PlayerUID, PlayerName GamePlayer
I'm programming an Android multi-player game, which basically consist of a server where the

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.