React
4
Вклад в тег
this.start = function() {
//console.log(interval);
if (working) return;
position = 0;
timer = window.setInterval(function(self) {
//console.log('timer');
position += step;
on_step(position, from, to);
if (position >= to) {
console.log('end1');
self.stop();
}
}.bind(null, this), interval);
on_start();
working = true;
on_step(position, from, to);
};
this.start = function() {
//console.log(interval);
if (working) return;
position = 0;
timer = window.setInterval(function() {
//console.log('timer');
position += step;
on_step(position, from, to);
if (position >= to) {
console.log('end1');
this.stop();
}
}.bind(this), interval);
on_start();
working = true;
on_step(position, from, to);
};