Jump to content
Search Community

Draggable and ScrollTrigger issue.

Vahan0799 test
Moderator Tag

Recommended Posts

Hey everyone!😀

This is my first attempt on using Draggable. And  I have a few problems here.

Is there a way to increase the speed of dragged slide and decrease the speed of scrolling?

With fast scroll they are flying instead of smooth slow scroll 😕 

And I have absolutely no clue, is it possible to stop ScrollTrigger and Draggable on last Element? There is a white huge gap appears at the end based on window width 😕

And Happy Tweeining everyone, GSAP is AWESOME! ♥

 

See the Pen bGLjNdJ by VahahBio (@VahahBio) on CodePen

Link to comment
Share on other sites

That code was originally based on the assumption that the elements are the width of the viewport, but it looks like you're using it in a very different way so you'd need to adjust the logic. 

 

As for making the scroll faster, it's all about the distance which you'd control using the "end" value on the ScrollTrigger. It's using the offsetWidth of the scrollContainer right now, so here's a fork that uses 1/10th of that: 

See the Pen YzeOWQW?editors=0010 by GreenSock (@GreenSock) on CodePen

 

You may need to adjust your CSS/markup to ensure there's enough to force scrolling. 

 

If you want the Draggable to go at a different speed, you'd need to adjust the logic in there. Most likely the ratio variable. These forums aren't so much for helping build out custom logic, but we're happy to answer any GSAP-specific questions. 👍

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