Jump to content
Search Community

Draggable knob inside a fixed container

burnkit
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Posted

I have a Draggable "knob" that sits in a header with a fixed position. It initially works as intended, but once you start scrolling down the page it gets harder and harder to rotate the knob - almost as if there's resistance being added to the knob as you scroll further down.

 

Here's a quick codepen to demonstrate what's happening (scroll down and try using the knob): 

See the Pen hrvnw by anon (@anon) on CodePen.

 

Is there a way to configure or adjust Draggable so that I don't have to do a workaround like temporarily setting the position of the header to absolute while the knob is being used?

GreenSock
Posted

Interesting - I hadn't anticipated that scenario, but thanks for pointing it out. Would you mind trying the attached [updated] version of Draggable which should factor in the scroll position? 

 

Just for the record, it had nothing to do with extra resistance - it's just that it was mis-plotting the rotation origin (pivot point), as if it were in the original position of the unscrolled page (in this case, at the top). 

Draggable_0.10.3_preview.zip

  • Like 3
Posted

The updated version is working great... thank you!

  • 3 months later...
Posted

Hello again!

 

I was just revisiting this and noticed that this fix doesn't work in Firefox (v30.0).

 

Can anything be done about this?

 

Thanks

  • 4 weeks later...
Posted

I'm so sorry for the delayed response. Your question slipped through the cracks. I have attached a preview of the next release of Draggable - does that work better for you? 

Draggable_0.10.7_preview.zip

  • 1 month later...
Posted

This does work. Thanks again!

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