Jump to content
GreenSock

Daniyarkz

Vertical infinite scroll

Go to solution Solved by akapowl,

Recommended Posts

Hello!
Please tell me what needs to be done to keep the blocks moving indefinitely vertically?

I tried to adjust the vertical change of blocks, but they update when they reach the height of one word, and not the height of the block

See the Pen MWOjpgR by Daniyar01 (@Daniyar01) on CodePen

Link to comment
Share on other sites

  • Solution

Hello @Daniyarkz

 

It looks to me like you tried to re-write the horizontalLoop helper function from the docs to make it work vertically?

 

I'm not sure it would be as easy as that, as I saw @GreenSock craft another version of a helper function specifically for vertical looping in this thread.

 

 

 

Here is one way you could utilize it to fit the logic you were trying to implement in your example.

I'm not sure if this is the best way to do it, but it works. Maybe it will help. Happy tweening!

 

See the Pen LYORWLW by akapowl (@akapowl) on CodePen

 

 

 

Edit:

 

And just now I saw the comment in the code, that the 'speed can be positive or negative (in pixels per second)'.

So this actually gets quite a bit easier in the end.

 

See the Pen RwjGVWq by akapowl (@akapowl) on CodePen

 

 

  • Like 4
Link to comment
Share on other sites

12 hours ago, akapowl said:

Hello @Daniyarkz

 

It looks to me like you tried to re-write the horizontalLoop helper function from the docs to make it work vertically?

 

I'm not sure it would be as easy as that, as I saw @GreenSock craft another version of a helper function specifically for vertical looping in this thread.

 

 

 

Here is one way you could utilize it to fit the logic you were trying to implement in your example.

I'm not sure if this is the best way to do it, but it works. Maybe it will help. Happy tweening!

 

 

 

 

 

 

Edit:

 

And just now I saw the comment in the code, that the 'speed can be positive or negative (in pixels per second)'.

So this actually gets quite a bit easier in the end.

 

 

 

 

 

Thank you so much! You helped a lot!

  • Like 1
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.
×