Jump to content
Search Community

snapping draggable to exact x and y values

logicearth test
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

Is it possible to have a draggable snap to exact co-ordinates rather than an array of x and y values? For example make it snap to {x:40,y:50} and {x:100,y:200} only? At the minute if I use snap:{x:[40,100], y:[50,200]} it will snap to all 4 combinations of these values.

Link to comment
Share on other sites

Hi and thanks for your question. 

 

Sounds like a tricky situation as currently the API only supports snap functions / arrays for x and y separately. It doesn't find the nearest point {x:value, y:value}

 

We will have to think about this some more and get back to you.

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