Home › Forums › JavaScript › jQuery plugin callback and ‘this’ › Re: jQuery plugin callback and ‘this’
April 8, 2013 at 6:19 pm
#131068
Participant
You can start by not adding vars to global scope:
var current_number = settings.startFrom;
This does fix the problem but the real issue is the timer that seems to ignore `clearTimeout`
console.log(timer + ‘: target = ‘ + settings.target.attr(‘id’) + ‘, number = ‘ + current_number);
settings.target.html(current_number);
If you log that you can see the timer keeps running, or at least it seems to.