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
"State Number Counter"
Bootstrap 4.1.1 Snippet by
sumi9xm
4.1.1
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
11.6K
 
3 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"> <div class="stat"> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="milestone-counter"> <i class="fa fa-user fa-3x"></i> <span class="stat-count highlight">122</span> <div class="milestone-details">Happy Customers</div> </div> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="milestone-counter"> <i class="fa fa-coffee fa-3x"></i> <span class="stat-count highlight">100</span> <div class="milestone-details">Ordered Coffee's</div> </div> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="milestone-counter"> <i class="fa fa-trophy fa-3x"></i> <span class="stat-count highlight">140</span> <div class="milestone-details">Awards Win</div> </div> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="milestone-counter"> <i class="fa fa-camera fa-3x"></i> <span class="stat-count highlight">500</span> <div class="milestone-details">Photos Taken</div> </div> </div> </div><!-- stat --> </div>
.milestone-counter { float: left; margin: 25px; text-align: center; } .stat { margin:10px auto; } .highlight { color:#111; padding:20px 0; font-weight:bold; display:block; overflow:hidden; margin-bottom:0; font-size:48px; } .stat i { color: #3498db; } .milestone-details { font-weight:bold; font-size:18px; color:#999; }
(function($) { "use strict"; function count($this){ var current = parseInt($this.html(), 10); current = current + 1; /* Where 50 is increment */ $this.html(++current); if(current > $this.data('count')){ $this.html($this.data('count')); } else { setTimeout(function(){count($this)}, 50); } } $(".stat-count").each(function() { $(this).data('count', parseInt($(this).html(), 10)); $(this).html('0'); count($(this)); }); })(jQuery);
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76