Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery plugin callback and ‘this’ Re: jQuery plugin callback and ‘this’

#131068
CrocoDillon
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.