The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Animated Progress Bar

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #45626

    Hey there everybody,

    I am having a small jQuery issue, basically i am trying to build a progress bar that would load from 0 to the given percentage over a period of 1-2 seconds.

    Look at what i have come so far based on a tutorial:

    The fiddle wouldn’t animate it, but let me describe what actually happens (apparently it does work on my test files).

    So the progress bar does load as supposed but it stops at the value given to “title=” in html. It wouldn’t accept percentages so if the set width is 460, to make the bar stop at 50%, i would have to give it a value of 230.

    Another issue about this script is that only the first bar actually takes the real value, all other ones just “copy” the first one no matter the values given to them. Looks strange to me.

    I am either looking for a way of solving both of these issues, or a better way of achieving the desired effect, preferrably with a way of inputting in percentages not pixel value.



    Hey Paulie,

    I’ve read the entire article and couldn’t come up with a solution. It doesn’t really help me achieve the desired progress bar (or does it?) and one bad thing about the progress element is that it’s only supported in IE10 which seems very “unfriendly” solution to me as i have seen a lot of jQuery based progress bars but couldn’t come up with a result myself.

    Still looking!


    Fair enough, if we go down your existing route…

    I’m no Jquery expert (barely a beginner) but it seems not impossible to me to use the various animation tools/options to animate a width over a set period.

    I’m not sure what the `title` attribute is adding here.


    Hi! :)
    Firstly, you should set Your “Frameworks & Extensions” in JSFiddle to can use jQuery.
    After that code starts working like you said. Only first bar is animated properly.
    It is becouse you set percent variable once:
    var percent = $(‘.progress_bar’).attr(‘title’);

    To fix it, iterate through all the bars. You can use “each” function to do this.



Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.