https://lemehovskiy.github.io/lem-counter/
# NPM
npm install lem_counter
<script src="TweenLite.min.js"></script>
<script src="jquery.min.js"></script>
<script src="lem_counter.js"></script>
<div class="counter">
0
</div>
<script type="text/javascript">
$('.counter').lemCounter({
value_to: 200
});
</script>
<html>
<head>
<title>My website</title>
</head>
<body>
<div class="counter">
0
</div>
<script src="TweenLite.min.js"></script>
<script src="jquery.min.js"></script>
<script src="lem_counter.js"></script>
<script type="text/javascript">
$('.counter').lemCounter({
value_to: 200
});
</script>
</body>
</html>
In lemCounter you can add settings using the data-lem-counter attribute. You still need to call $(element).lemCounter() to initialize lemCounter on the element.
Example:
<div class="counter"
data-lem-counter='{"value_from": 100, "value_to": 500}'>
</div>
Option | Type | Default |
---|---|---|
value_from | int | 0 |
value_to | int | 0 |
locale | bool/string | false |
value_to_from_content | bool | false |
animate_duration | int | 2 |
- Chrome
- Firefox
- Opera
- IE10/11
- jQuery 1.7
- Gsap