Javascript 如何为anime.js中的一个目标在每个循环上调用函数
我尽我最大的努力使它工作,但我不能想出它。在anime.js timeline中,如何在每个循环中仅为一个目标调用函数 这是我的剧本:Javascript 如何为anime.js中的一个目标在每个循环上调用函数,javascript,animation,ecmascript-6,anime.js,Javascript,Animation,Ecmascript 6,Anime.js,我尽我最大的努力使它工作,但我不能想出它。在anime.js timeline中,如何在每个循环中仅为一个目标调用函数 这是我的剧本: const images = document.querySelectorAll('.bannerImage'); function animateImage() { anime({ targets: '.image3', opacity: '1', duration: 2000, eas
const images = document.querySelectorAll('.bannerImage');
function animateImage() {
anime({
targets: '.image3',
opacity: '1',
duration: 2000,
easin: 'easeInOutExpo'
});
}
const timeLine = anime.timeline({
duration: 2000,
easing: 'easeInOutExpo',
loop: true
}).add({
targets: '.image3',
opacity: '0',
}).add({
targets: '.image2',
opacity: '0',
}).add({
targets: '.image1',
opacity: '0',
loopBegin: function (anime) {
animateImage();
}
});
这里是js fiddle,我试图使用setInterval制作它