Multiple instances of ProgressBar can be grouped together and animated for a dynamic interface.
Here we draw a set of several ProgressBars with
direction set to move from bottom to top (
We set up the Animation Utility to handle the movement for us.
In order to produce a more realistic movement, instead of giving random values to each of the bars independently, we
are using Animation's own Bezier function to calculate a Bezier curve based on four random points, then we take eight
evenly spaced points from that curve to use as values for each bar.
To keep the bars moving, we listen for the
complete event that signals the end of an animation
to start a new animation.
The code for this example is:
Custom CSS defines the background image of the bar itself, groups the instances in a line with suitable spacing and encloses the set within a common border.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.