Jump to content


Draggable update bounds attribute

Go to solution Solved by Diaco,

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



How can I update bounds attribute, without creating new instance?



 Draggable.create("#elmnt", {
        bounds:{minX:-200, maxX:0, minY:-200, maxY:0},
It it would look like this ;)
Draggable.update("#elmnt",{ bounds:{minX:-100, maxX:0, minY:-150, maxY:0}});
Link to comment
Share on other sites

  • Solution

Hi chriswyl :)


you need .applyBounds() : 




var draggable =  Draggable.create("#elmnt", {
   type:"x,y" ,
   bounds:{minX:-200, maxX:0, minY:-200, maxY:0}

draggable[0].applyBounds({minX:-100, maxX:0, minY:-150, maxY:0});// Immediately updates and applies bounds
  • Like 5
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.