Jump to content
Search Community

Draggable slider without momentem scrolling and snapping with InertiaPlugin

Joshua721 test
Moderator Tag

Recommended Posts

Hey, I'm quite new to GSAP and trying to make a slider/carousel. I've looked at the helper codepen which is what i've used in my code pen, and works fine without the InertialPlugin, but when I use the same code in development the slider is no longer draggable.
Could it be that using code that requires the InertialPlugin while not having access is breaking the animation?

Sorry if the codepen above doesn't show much, its hard to show a coded repensentation of my development problem.

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

 

(edit)
Even something like this  But without the InertialPlugin. I've been looking at the code for a while and not sure which parts use the InertialPlugin

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

Link to comment
Share on other sites

Hi there Joshua, could we see your codepen attempt rather than the working GSAP versions? It's hard to debug without seeing the issue. That'll be a very helpful step towards figuring this out.

 

Quote

I've looked at the helper codepen which is what i've used in my code pen, and works fine without the InertialPlugin, but when I use the same code in development the slider is no longer draggable.

Although if I understand this correctly you have a demo that works locally but not in dev,. If this is correct - there's not a huge amount we can do. That's largely a game of 'spot the difference' between the local (working) demo and the live (broken) demo.

Link to comment
Share on other sites

Its hard because when inside codepen, it works the way i want, but in dev the drag stops.

I want the motion part which uses the InertialPlugin removed because I don't have access to that plugin, but i'm not sure what part of the code uses that plugin.
For example if you remove the "https://assets.codepen.io/16327/InertiaPlugin.min.js" from the codepen, thats how it want it, but for some reason it works prefrectly fine in codepen but in dev stops all function of the drag.
Not sure if there is a way around using that plugin or not

 

(edit)

i've found this codepen that doesn't use the plugin so maybe this is the right direction?

See the Pen GREebPK by mvaneijgen (@mvaneijgen) on CodePen


 

Edited by Joshua721
Update with more context
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...