Saturday, 31 August 2013

How to slideUp like an odometer

How to slideUp like an odometer

I've got this, and it's "good enough", but my original vision was to have
the numbers roll up like an odometer:
setTimeout(slideUp,2000);
function slideUp() {
$('#odometer').slideUp('slow','swing',slideDown);
}
function slideDown() {
$('#odometer').removeClass('highlight').slideDown('slow');
}
So what it does is: when the page loads, the number is highlighted. Two
seconds after the page loads, it slides up out of sight and then slides
down in a normal font.
But what I'd like for it to do is count up to the number like an odometer.
I could give it a starting number as well, so that the user wouldn't have
to watch it count to an exorbitantly high number.

No comments:

Post a Comment