ProgressBar is a tiny and simple jQuery plugin that displays status of a determinate or indeterminate process.
ProgressBar is a tiny and simple jQuery plugin that displays status of a determinate or indeterminate process.
It is a visual element to show the progress of an activity. The default theme of the progress bar is gradient; but you can change it on your own. It can divide the progress into several equal parts, and optionaly can show the percentage of the current activity in progress.
/* Attach the Progress Bar CSS file */
<link rel=" stylesheet" type="text/css" href="css/tinytools.progressbar.min.css">
/* jQuery needs to be attached */
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
/* Then attach the Progress Bar plugin */
<script src="tinytools.progressbar.min.js"></script>
<div id="ProgressBarSample"></div>
<script>
$(document).ready(function () {
$("#ProgressBarSample").progressBar();
});
</script>
Property | Default | Description |
---|---|---|
width | false | The width of the progress bar. You can define the width of the progress bar in the css of the element. If not defined, the default value will be '200px' |
height | false | The height of the progress bar. You can define the height of the progress bar in the css of the element. If not defined, the default value will be '20px' |
percent | 0 | The initial percentage of the progress bar. |
showPercent | true | If true, the current percentage will be shown at the center of the progress bar. |
split | 1 | The progress bar will be divided into split parts. |
backSplitLineColor | '#999' | The color of the split lines on the background. |
foreSplitLineColor | '#ddd' | The color of the split lines on the bar. |
onPercentChanged | false | callback that fires after changing the percentage. Parameters: 1- Percentage value, 2- Caller |
Method | Description |
---|---|
$(selector).changePercent(newPercent) | Changes the value of the current percentage of the progress bar. |
$(selector).getPercent() | Returns the current effective value of the progress bar percentage. If selector returns more than one progress bar, the percentage of the first one will be the answer. |