Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"progress bar"
Bootstrap 4.1.1 Snippet by
atifkhan
4.1.1
jQuery
progress bar
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
24.1K
 
2 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <h2>Progress Bar</h2> <div class="row text-center"> <div class="col-sm-4"> <div class="progressbar"> <div class="second circle" data-percent="77"> <strong></strong> <span>animation <br> progress</span> </div> </div> </div> <div class="col-sm-4"> <div class="progressbar"> <div class="second circle" data-percent="55"> <strong></strong> <span>animation <br> progress</span> </div> </div> </div> <div class="col-sm-4"> <div class="progressbar"> <div class="second circle" data-percent="100"> <strong></strong> <span>animation <br> progress</span> </div> </div> </div> </div> </div> <script src="https://rawgit.com/kottenator/jquery-circle-progress/1.2.2/dist/circle-progress.js"></script>
.circle { width: 200px; margin: 6px 6px 20px; display: inline-block; position: relative; text-align: center; line-height: 1.2; } .circle canvas { vertical-align: top; width: 200px !important; } .circle strong { position: absolute; top: 30px; left: 0; width: 100%; text-align: center; line-height: 40px; font-size: 30px; color: black; } .circle strong i { font-style: normal; font-size: 0.6em; font-weight: normal; } .circle span { display: block; color: #aaa; margin-top: 12px; }
$(document).ready(function ($) { function animateElements() { $('.progressbar').each(function () { var elementPos = $(this).offset().top; var topOfWindow = $(window).scrollTop(); var percent = $(this).find('.circle').attr('data-percent'); var animate = $(this).data('animate'); if (elementPos < topOfWindow + $(window).height() - 30 && !animate) { $(this).data('animate', true); $(this).find('.circle').circleProgress({ // startAngle: -Math.PI / 2, value: percent / 100, size : 400, thickness: 15, fill: { color: '#663399' } }).on('circle-animation-progress', function (event, progress, stepValue) { $(this).find('strong').text((stepValue*100).toFixed(0) + "%"); }).stop(); } }); } animateElements(); $(window).scroll(animateElements); });
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76