Installation
  • Include JS
    <script src="jquery.min.js"></script>
    <script src="TweenLite.js"></script>
    <script src="lem_counter.js"></script>
  • Set HTML
    <div class="counter"></div>
  • Call the plugin
    $('.counter').lemCounter({
      value_to: 100
    });
Demos
  • Animate to
    $('.counter-demo-1').lemCounter({
      value_to: 100
    });
    0
  • Animate from to
    $('.counter-demo-2').lemCounter({
      value_to: 100,
      value_from: 200
    });
    200
  • Value to from content
    $('.counter-demo-3').lemCounter({
      value_to_from_content: true
    });
    <div class="counter-demo-3">
      100
    </div>
    100
  • Settings from data attribute
    $('.counter-demo-4').lemCounter();
    <div
    class="counter-demo-4"
    data-lem-counter='{"value_from": 100000, "value_to": 1000, "animate_duration": 3, "locale": "en-US"}'>
    </div>
Events
  • onComplete
    $('.counter-event-demo-1').lemCounter({
      value_to: 100
    });
    
    $('.counter-event-demo-1').on('onComplete.lc', function () {
      $(this).css('color', 'red');
    });