Closed GoogleCodeExporter closed 8 years ago
It seems that my fix wasn't really a fix. It causes a JavaScript error which
somehow gave the expected functionality.
I'm figuring out how to actually fix this problem now. So ignore the fix in the
ticket for now. The problem still exists though.
Original comment by willem....@gmail.com
on 18 Aug 2011 at 7:04
I've found the problem. It seems that the option 'time' is somehow never reset
to 0 in _doAnimation. I've been following that variable and it keeps
incrementing no matter what I do.
It's almost as if the _doAnimation function is running in its own instance and
has its own set of options once it's started. And that set of options can't be
manipulated outside of that function.
I've done the following to fix it. Maybe it's not a clean fix, but at least it
works for me.
// Do animation step
function _doAnimation() {
var time = _getOption('time');
var start_number = _getOption('start_number');
var number_change = _getOption('end_number') - start_number;
var duration = _getOption('duration');
var easing = _getOption('easing');
// apply easing function
var new_num = easing.apply(obj, [false, time,start_number,number_change,duration]);
_setOption('number', new_num);
_renderCounter();
if(time >= duration) {
_stopAnimation(); // if animation has expired, stop it
}
if(time >= duration) {
_stopAnimation(); // if animation has expired, stop it
_setOption('time', 0); // clear time step
}
else
{
_setOption('time',time+1); // increase time step
}
}
Original comment by willem....@gmail.com
on 18 Aug 2011 at 7:49
Attachments:
Ah I've only know come to see that this is the project page for
jquery-numberformatter. I'm posting on the wrong project page. I'm very sorry.
You can delete and ignore this ticket completely.
Original comment by willem....@gmail.com
on 18 Aug 2011 at 7:58
No worries, removed. I was a little curious when I saw the title :P
Original comment by apar...@gmail.com
on 7 Sep 2011 at 3:39
Original issue reported on code.google.com by
willem....@gmail.com
on 18 Aug 2011 at 6:44