I try to put an image on my site that is continuously moving up and down, forever, without any interaction.
I’ve read through the whole internet and I’ve found this:
However, as soon as I add the #img.shake {}; part of my js code, the image suddenly disappears.
Can someone give me a simple solution for this question? Is it possible to do this in Velo?
import { timeline } from ‘wix-animations’
$w . onReady ( function () {
const target1 = $w ( ‘#image_x’ );
const reset = { y : 0 , x : 0 , scale : 1 , duration : 1600 , easing : ‘easeOutBack’ };
timeline ({ repeat : - 1 , yoyo : true })
. add ( target1 , { y : 100 , x : 0 , scale : 1 , duration : 1600 , easing : ‘easeInBack’ })
. add ( target1 , { y : - 100 , x : 0 , scale : 1 , duration : 1600 , easing : ‘easeOutBack’ })
. play ()