Jump to content


Fixed Positioning inside a Draggable instance

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

Hey Guys,


As always this library is awesomazing.


I am working with a draggable instance and I want to set an element inside to fixed. I have no problem adding a class to the container on the appropriate position. The problem is, that fixed element still sits inside the draggable instance due to the relative positioning of it. Any way around this?





Link to comment
Share on other sites

You don't want it to be draggable then (when it's fixed) of course, right? Any reason you wouldn't just re-nest that element so that it's no longer inside the Draggable element? 

Link to comment
Share on other sites

Hey Jack,


The main issue with pulling the content out and re-nesting is one of formatting. While that certainly would be a solution, the fixed elements are part of a larger format that does not lend itself well to simply popping it out of the draggable instance.  When I lose the draggable instance and go with a native scroll it is just a matter of adding the correct class at the correct scroll position.  I will post up a draggable solution if I work one out.


Awesome utility though and I still use it in several locations.

Link to comment
Share on other sites

Yeah, maybe it'd help if you whipped together a super simple codepen demo that shows the behavior you want - I'm having a tough time visualizing the challenge(s). I bet once I saw a codepen, the light would go on. 



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.