Jump to content
Search Community

GSAP seamplessLoop helper function with flexible width elements and active class on active element.

DW92 test
Moderator Tag

Go to solution Solved by Toso,

Recommended Posts

Hi. I'm trying to utilize helper function "seamlessLoop".

I'm trying to use this example: , but have some problems, with that:

1. When I use  const boxes = gsap.utils.toArray(".box"); and passing that constant to horizontalLoop() function, this happens:
image.thumb.png.f84a6d938eb8a8866efcf2a7724eb133.png
but when I pass html selectors directly '.js--pelion-reviews-tape .wrapper .box' it works fine as a loop/marquee.

The problem I get here is that onChange method doesn't work (doesn't add and remove "active" class).

Here is my code:

See the Pen oNVRqJb by DW922 (@DW922) on CodePen



The only thing I want to achieve here is to have a "marquee", with "active" (center I guess) element highlighted.
 

 

Thanks for all your help :)

See the Pen gOvvJee by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

h1 @DW92  maybe something like 🤔

 

this one without any functions 

See the Pen PoLvaKM?editors=1010 by ahmed-attia (@ahmed-attia) on CodePen

 

 

in your demo, you didn't load gsap so this code won't work in a million years 😂

 

 

here is how you load gsap

 

image.thumb.png.fa7ea177f32bbf7a2bfee703411ff08c.png

 

 

or just fork this demo it contains all the plugins 

 

See the Pen OPqpRJ by GreenSock (@GreenSock) on CodePen

  • Like 1
Link to comment
Share on other sites

Hi @Toso Thanks for your help!

I'm just showcasing this code on codepen. Testing it on my local enviroment, so I'm sure gsap is working just fine (with problems I mentioned).

Is it possible to make "slides" jump, one after another, instead of smooth movement, in your example?

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...