Option name | Type | Description |
---|---|---|
selector | domelement_or_jqueryobject | The element that will behave as a scrollbar |
options | object | Object containing settings for this progress bar |
NATION.Utils
NATION.EventDispatcher
Progress bar displaying a percentage from 0 to 100
Selector is expected to contain an element with class 'js-progress' or 'progress', which is the actual progress bar itself. The width of this element is changed as a percentage to represent the desired percentage to display
Selector can contain a clickable hit area. This should be an element with the class 'js-hitarea' or 'hitarea'
Selector can also contain a handle, by using class 'js-handle' or 'handle'
Selector can also contain a separate load progress bar, marked with class 'js-loaded' or 'loaded'. This can be set to different percentages than the progress bar, via the 'setLoaded' method. This will also resize the hit area element to match
Event that fires when the progress bar has been clicked
Event that fires when a handle drag has started
Event that fires each time the user moves the handle during a drag
Event that fires when the user releases the handle
Event that fires when the value of the progress bar changes
Returns true if the user is currently dragging the handle
Returns the currently displayed percentage
Returns the percentage corresponding to where the user last clicked
Option name | Type | Description |
---|---|---|
percentage | number | The percentage to show, between 0 and 1 |
Display a passed percentage
Option name | Type | Description |
---|---|---|
percentage | number | Percentage between 0 and 1 |
adjustHitArea | boolean | Whether to match hitarea width to progress bar width |
Set the load bar position via a percentage
Option name | Type | Description |
---|---|---|
percentage | number | Percentage to position the handle at, between 0 and 1 |
Set the handle to a percentage along the bar