JSFiddle - React, Tailwind, and code Playground
by asou ryouma
HTML
<p>count: <span id="counter">500</span></p>
JavaScript
$(function() {
var current = $('#counter').text();
// 0からスタートしてセットした値までカウントアップさせる
$({count: 0}).animate({count: current}, {
duration: 1000,
easing: 'linear',
progress: function() {
$('#counter').text(Math.ceil(this.count));
}
});
});