-
Notifications
You must be signed in to change notification settings - Fork 246
Creating a ProgressJS object.
Available since: v0.1.0
Parameters:
- targetElm : String (optional)
Should be defined to start progress-bar for specific element, for example:
#targetElement
.
Returns:
- progressJs object.
Example:
progressJs() //without selector, set progress-bar for whole page
progressJs("#targetElement") //start progress-bar for element id='targetElement'
Start the progress-bar for defined element(s).
Available since: v0.1.0
Returns:
- progressJs object.
Example:
progressJs().start()
Set specific percentage to progress-bar
Available since: v0.1.0
Parameters:
- percent: Number
Set to specific percentage
Returns:
- progressJs object.
Example:
progressJs().set(20); //set progress to 20%
Set an auto-increase timer for the progress-bar.
Available since: v0.1.0
Parameters:
-
size: Number
The size of increment when timer elapsed -
millisecond: Number
Timer in milliseconds
Returns:
- progressJs object.
Example:
progressJs().start().autoIncrease(4, 500); //every 500 milliseconds, percentage + 4
Increase the progress-bar bar specified size. Default size is 1.
Available since: v0.1.0
Parameters:
- size: Number
The size of increment
Returns:
- progressJs object.
Example:
progressJs().increase(); //increase one percent
progressJs().increase(2); //increase two percent
End the progress-bar and remove the elements from page.
Available since: v0.1.0
Returns:
- progressJs object.
Example:
progressJs().start().set(20).end()
Set a single option to progressJs object.
Available since: v0.1.0
Parameters:
-
option : String
Option key name. -
value : String/Number
Value of the option.
Returns:
- progressJs object.
Example:
progressJs().setOption("theme", "black");
Set a group of options to the progressJs object.
Available since: v0.1.0
Parameters:
- options : Object
Object that contains option keys with values.
Returns:
- progressJs object.
Example:
progressJs().setOptions({ 'theme': 'black', 'overlayMode': true });
Set a callback function for before end of the progress-bar.
Available since: v0.1.0
Parameters:
- providedCallback : Function
Returns:
- progressJs object.
Example:
progressJs().onbeforeend(function() {
alert("before end");
});
Set a callback function to call before start the progress-bar.
Available since: v0.1.0
Parameters:
- providedCallback : Function
Returns:
- progressJs object.
Example:
progressJs().onbeforestart(function() {
alert("before start");
});
Set callback function to call for each change of progress-bar.
Available since: v0.1.0
Parameters:
- providedCallback : Function
Returns:
- progressJs object.
Example:
progressJs().onprogress(function(targetElm, percent) {
alert("progress changed to:" + percent);
});