Jump to content
Search Community

Use a variable to change a repeated tween duration

Pata test
Moderator Tag

Go to solution Solved by mikel,

Recommended Posts

Hello,

 

I'm trying to modify the duration of a tween by using a variable that changes on a mousemouse event. I want the elements to rotate (move along the path) faster or slower depending on the mouse position.

 

The variable is called "speed". As you can see on the Codepen link I'm trying to make this on the first tween: "duration: 20 + speed" but obviously it is not the correct way because when a transition is created it's not suposed to be modified.

 

Sooo... there's a way?

 

Many thanks in advance,

See the Pen WNXdMPo by pataduprins (@pataduprins) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...