Hai guys, I need to move my image in site while scrolling the page, can anyone pls help me to solve this…i didn’t have any idea in my mind…Thank you😄
You simply can’t move elements!
The only way to animate a movement, is to use the timeLine…
https://www.wix.com/corvid/reference/wix-animations/timeline-obj
You can vote for the “movement-feature” here, i also was looking for such a feature, where you can control positions of elements with CODE, here…
I’m a little bit late, but here’s some code that can help you accomplish this:
import wixAnimations from 'wix-animations';
//This will help you manage the state of the object, if it has been animated or not
let isBundleVisible= false;
const timeline = wixAnimations.timeline();
$w.onReady(function () {
//Add the animation to the timeline object, this options will move the object 60px down
timeline.add($w('#box15'), {y: 60, duration: 700, easing: 'easeInOutQuad'})
});
export function box15_click(event) {
if (!isBundleVisible){
//Play the animation
timeline.play()
isBundleVisible=true;
return;
}
//Play the animation backwards
timeline.reverse();
isBundleVisible=false;
}
You can also pin an element to the screen by right clicking on it