This example shows the simplest ProgressBar with the default "Sam" skin. Use the controls below to change various settings.
The ProgressBar itself is created with this code:
Most of the code for this example deals with handling the interface, the sliders and other input controls. When a value is changed, it is simply applied to the corresponding attribute of the ProgressBar. The ProgressBar responds when the slider is released, not while it is moving. Leaving aside all the interface details, these are the statements that deal with those settings:
In all cases, the scaling factors used to convert the slider pixel values to the
values used for the ProgressBar have been omitted. The anim
attribute, while it receives a boolean, returns either an instance of Animation or null.
The value
attribute of the radio buttons
for selecting the easing method have been set to the actual names of the methods
so it is easy to locate them in the YAHOO.util.Easing
object.
The ProgressBar rejects values outside of the range
given by minValue
and maxValue
so the slider goes
back to the current value read from the ProgressBar itself.
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
Note: You are viewing this example in debug mode with logging enabled. This can significantly slow performance.
Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings