Closed jmahony closed 7 years ago
I'm an idiot This:
TweenLite.to(window, 0.66, {
scrollTo: {
y: (n - 1) * 1000
},
onComplete: function () {
document.querySelector('#msg').textContent = 'last onComplete fired for section #' + n;
},
autoKill: true,
onAutoKill: function() {
document.querySelector('#msg').textContent = 'onAutoKill fired for section #' + n;
}
});
Should be:
TweenLite.to(window, 0.66, {
scrollTo: {
y: (n - 1) * 1000,
autoKill: true,
onAutoKill: function() {
document.querySelector('#msg').textContent = 'onAutoKill fired for section #' + n;
}
},
onComplete: function () {
document.querySelector('#msg').textContent = 'last onComplete fired for section #' + n;
}
});
From what I understand
onAutoKill
should only be called when the tween is interrupted, but it seems to be called when the tween begins.An example: https://jsfiddle.net/tuhm6rcb/
Is this a bug or am I misunderstanding
onAutoKill
?Thanks :)