Hello guys, i'm a newbie dev here. Can you help me whats the best approach when fading in/out image background? Please help. Thanks in advance
import wixAnimations from ‘wix-animations’;
$w.onReady(function () {
// Define the animation timeline.
const fadeTimeline = wixAnimations.timeline({
repeat: -1, // Repeat the animation for ever.
yoyo: false // Reverse the animation when it’s done - fade in and out.
});
// The element that we want to animate
const element = $w(‘#imageX5’);
const element2 = $w(‘#imageX6’);
const element3 = $w(‘#imageX7’);
// Animations
const fadeAnimation = {
opacity: 0,
duration: 3000 // In milliseconds
};
// Apply the animation on the above element using the timeline created above
fadeTimeline.add(element, fadeAnimation);
fadeTimeline.add(element2, fadeAnimation);
fadeTimeline.add(element3, fadeAnimation);
fadeTimeline.play()
});