示例
Animate to
$('.counter-demo-1').lemCounter({
value_to: 100
});
Animate from to
$('.counter-demo-2').lemCounter({
value_to: 100,
value_from: 200
});
Value to from content
$('.counter-demo-3').lemCounter({
value_to_from_content: true
});
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"}'>1,000
</div>
事件:onComplete
$('.counter-event-demo-5').lemCounter({
value_to: 100
});
$('.counter-event-demo-5').on('onComplete.lc', function () {
$(this).css('color', 'red');
});