Open Jakobud opened 7 years ago
have this same issue!
How do you put into HTML?
im having same issue as well
My solution (in PHP):
PHP:
$limit = 750000; // hard-coded
$num_digits = strlen( (string) $limit );
$count = 10; // hard-coded
$digits = str_split( str_pad( count, $num_digits, '0', STR_PAD_LEFT ) );
foreach ( $digits as $digit ) {
echo '<span class="odometer">' . $digit . '</span>';
}
JavaScript:
new Odometer({
el: document.querySelector('.odometer')
});
https://github.com/wqzwh/odometer try this
@wqzwh add your unminified source code to your repository.
Any respond from offical? Can add 0d' format?
@Giovanni #160
I have a number that I want to start at 0000 and use odometer to count up to 9999. But odometer displays a single zero (0) instead of 0000. Is it possible to make it pad with more zeros?