top of page

How to create an 
 infinity rotation 
in one minute

You can also turn the animation on or off in Hover or Click

import wixAnimations from 'wix-animations';

 

$w.onReady(function () {

 

wixAnimations.timeline({ repeat: -1 })

.add($w('#your-item-id'), { rotate: 360, duration: 40000, easing: 'easeLinear' })

.play()

 

});

Copy Code

You can rotate any element using the wix Animation API

import wixAnimations from 'wix-animations';

 

const rotateTimeline = wixAnimations.timeline({ repeat: -1 });

 

$w.onReady(function () {

 

rotateTimeline

.add($w('#your-item-id'), { rotate: 360, duration: 40000, easing: 'easeLinear' });

 

$w('#some-element-id').onMouseIn(() => {

rotateTimeline.play();

});

 

$w('#some-element-id').onMouseOut(() => {

rotateTimeline.pause();

});

 

});

Copy Code
bottom of page