zurakobakhidze Posted October 6, 2023 Share Posted October 6, 2023 Hi all, I built this slider a while ago. As you can see there is a lot of js bloat but since it worked I was happy with it. Now coming back to it I would like to improve it and make use of loop to be able to add more slider items etc. The logic is pretty simple but also tricky to get right. Any suggestions on how to make the code more efficient while keeping the same functionality? Cheers! See the Pen dywQreE by Kobakhidze (@Kobakhidze) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted October 6, 2023 Share Posted October 6, 2023 Hi, You are right, that's a lot of code there! Unfortunately we don't have the time resources to comb through all that code and find a way to improve it and/or provide free general consulting. There are plenty of examples in the forums of content sliders. These are just a few: @PointC See the Pen YRzRyM by PointC (@PointC) on CodePen GreenSock collection: See the Pen jOQXYzV by GreenSock (@GreenSock) on CodePen See the Pen vYQbZYy by GreenSock (@GreenSock) on CodePen See the Pen JjrWXNq by GreenSock (@GreenSock) on CodePen See the Pen QWGXdyd by GreenSock (@GreenSock) on CodePen Even though their codes are not identical they follow a similar pattern in how to move from one slide to another. Loop or no loop in the code, that's pretty much the key in these scenarios. Hopefully this helps. Happy Tweening! 1 Link to comment Share on other sites More sharing options...
zurakobakhidze Posted October 8, 2023 Author Share Posted October 8, 2023 @Rodrigo No worries, I thought I would ask. Thank you for the references. Cheers! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now