plugins - How to change 'this' in jquery callback -
i have written jquery plugin takes number in div , makes count up. i've tried add callback when finishes starts on next div. when starts working on next div first resets number in current div, before carrying on on next div expected. suspect using 'this' inside of plugin. here full (not) working example --> how prevent happening? thanks my plugin: (function( $ ) { $.fn.countup = function(options) { var settings = $.extend( { 'startfrom' : 0, 'countto' : number(this.text()), 'start' : 10, 'frequency' : 200, 'jump' : 1, 'target' : this, 'log' : false, 'callback' : '' }, options); var intregex = /^\d+$/; if(intregex.test(settings.countto) && intregex.test(settings.startfrom) ) { // both settings integers, started: if(settings.star