Jump to content
Search Community

Inertia effect is not working within a draggable UI on Webflow site

jakelaz test
Moderator Tag

Recommended Posts

Hi, we're having issues getting the inertia effect to work within a draggable component on my Webflow site (https://mor-life.webflow.io/). The #canvas element contains a bunch of .box elements (see the screenshot below). Despite the fact that dragging works, the really delightful inertia/throw animation does not. We more or less copy/pasted the draggable JS snippet from the Draggable Toss demo on Codepen, where inertia works beautifully. The only change we made was the removal of the snap-to-grid elements. We purchased the bonus plugins yesterday and would really like to get this working. Code can be inspected quite easily on Webflow, but copied below as well.

 


  var $container = $("#canvas");

  Draggable.create(".box", {
    bounds: $container,
    edgeResistance: 0.65,
    type: "x,y",
    inertia: true,
    autoScroll: true
  });

 

1507188128_ScreenShot2021-12-30at3_24_27PM.thumb.png.42738ff50d73b55fb72d5578071b11c7.png

Thanks in advance for the support!

 

 

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

Link to comment
Share on other sites

Thanks for the demo! It was very helpful

 

The InertiaPlugin file you are using is for modules, but you should be using the file that is located in the minified folder, InertiaPlugin.min.js.

 

Here's it working with the correct file. Also, it's a good idea to register your plugins.

 

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

 

  • Like 1
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...