Jump to content
Search Community

horizontal - scroll trigger with touch

renny test
Moderator Tag

Recommended Posts

I'm not sure how else we can help. The demo you posted is already functional and doing what you'd like it to.

All that's left is to style it.

I'm afraid we can't help you there but if you need assistance maybe someone in the freelance forum can help you.

Link to comment
Share on other sites

Hi @renny. Please read the forum guidelines - we're happy to help with any GSAP-specific questions like "how do a set the duration of a tween" or "how do I reverse a timeline", but we don't have the resources to provide free build-to-order solutions where you provide a list of requirements and we tell you how to build it. That would take a lot of time. The best place for that kind of thing would be the freelance forums where you can hire someone. 

 

Good luck with your project.

Link to comment
Share on other sites

By the way, I glanced at the CodePen and I think you're just doing your dragRatio calculation incorrectly - that's based on the assumption that each "section" is taking up the entire width of the screen AND the tween is animating by 100vw but your sections are smaller than the screen and you're only animating 75vw. I assume this would be more accurate: 

var dragRatio = scrollContainer.offsetWidth / (sections[0].offsetWidth * 0.75 * (sections.length - 1));

But that assumes that the first section element's width is the same as all the others. If you need variable widths, you'd need to adjust the formula accordingly. 

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