Closed jimzou closed 3 years ago
Solved by the following method:
var rot = 0;
var self= this;
function func_rotate() {
anime({
targets: '.div1',
rotateY: function(el,i) {
console.log(self.rot);
self.rot+=60;
return self.rot; },
delay: 1000,
easing: 'easeOutSine',
autoplay: true,
complete: fun_rotate
});
}
func_rotate();
Variables cannot hold values in a callback function:
in the line " console.log(self.rot);" , rot is always 0. I don't know how to solve this problem