Hi everyone,
I've been using GSAP for so long that I think I am having a weird brain freeze and I am unable to create an indexing where the middle
image on the slider will take a, let's say, "selected" class.
I have used a previous implementation I found in my codepen and I have commented the section where I started my effort of getting an index
value for start. Under the snap function.
Any help would be greatly appreciated!
See
I spent a bunch of time reworking the helper function to accommodate a new option, center: true which will basically make the active element be the one that's centered in the container. Here's a fork that adds an "active" class to the element in the center, and I made one of the elements wider just to make sure it still works when they're not all the same width:
See the Pen gOvvJee?editors=0010 by GreenSock (@GreenSock) on CodePen
I added an onCh