Animation move from right to left direction

Asked

Viewed 47 times

-1

I have this little animation in javascript, which makes my background move however, this sometimes moves from right to left and has other times that moves from left to right.

How would you ever move from right to left.

Code:

        $('#cores').animate({
 'background-position-x': cd.position
},{ duration: 6000, 'easing':'easeOutCubic'

Thank you.

  • What is the cd.position?

  • The cd.position is a part that receives via the nodejs socket.

1 answer

0

Try to define two sides, left and right as a variable. Then try to make the background follow this variable according to the speed and effect you want..

If that’s what I understand, you can follow this logic

Take a look at this site: All Animation , I think there should have the effect that you want! I think you can have a good idea.

Good luck!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.