"counter"
Bootstrap 4.1.1 Snippet by ranjit1602

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<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 ---------->
<!-- Include following into your head tag
*******************************-->
<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>
<!-- Content
*********************************************-->
<header>
<div class="container">
<div class="row">
<div class="col-12 text-center">
<h1>Count up to an target number</h1>
</div>
</div>
</div>
</header>
<div class="counter">
<div class="container">
<div class="row">
<div class="col-12 col-lg-3">
<div class="count-up">
<p class="counter-count">100</p>
<h3>Counter 1</h3>
</div>
</div>
<div class="col-12 col-lg-3">
<div class="count-up">
<p class="counter-count">200</p>
<h3>Counter 2</h3>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
header {
background-color: #000000;
color: #ffffff;
padding: 20px 0px;
}
h1, h3 {
text-transform: uppercase;
}
.counter
{
text-align: center;
}
.counter-count
{
font-size: 50px;
font-weight: bold;
position: relative;
color: #000000;
text-align: center;
display: inline-block;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
$('.counter-count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
//chnage count up speed here
duration: 4000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: