webcito / jquery-bs-circle-progress
The plugin displays a process in the form of a circle using Bootstrap and jQuery.
dev-main
2024-01-19 08:23 UTC
Requires
- components/jquery: >=1.9
Requires (Dev)
- twbs/bootstrap: >=v4.0.0
This package is auto-updated.
Last update: 2024-12-19 10:21:22 UTC
README
The plugin displays a process in the form of a circle using Bootstrap and jQuery.
Requirements
- Bootstrap >= v4.0.0 (Works with Bootstrap 5.x)
- jQuery >= 1.9
Installing
Manual
Download the compressed file jquery-bs-circle-progress.min.js from the dist folder. Upload it to your project and include it before the tag but after the jQuery script.
<script src="path/to/jquery/jquery.min.js"></script> <script src="path/to/twbs/bootstrap/dist/js/bootstrap.bundle.min.js"></script> <script src="path/to/jquery-bs-circle-progress.min.js"></script> <script> // custom scripts </script> </body>
Manual
composer require webcito/jquery-bs-circle-progress:dev-main
Usage
html
<div id="my_first_progress"></div>
javascript
$('#my_first_progress').circleProgress();
That's it!
Plugin options
example
$('selector').circleProgress({ size: 350, value: 12, color: '#506886' });
Plugin methods
example
$('selector').circleProgress({ size: 350, value: 12, color: '#506886' }); let seconds = 0; let testInterval = null; testInterval = setInterval(function () { if (seconds === 100) { clearInterval(testInterval) } let color; switch (true) { case seconds < 20: color = 'danger'; break; case seconds < 40: color = 'warning'; break; case seconds < 60: color = 'info'; break; case seconds < 80: color = 'primary'; break; default: color = 'success'; break; } $('selector').circleProgress('updateOptions', { value: seconds, color: color }); seconds++; }, 100)