cpkn_dev Posted April 26, 2021 Share Posted April 26, 2021 (edited) Currently I'm trying to use draggable to be able to move blocks onto target spots, and if the spot isn't "exact" it would adjust them to be exactly on top of the element. I've attached a minimal example The part I'm getting stuck on is here: // move onto target gsap.to(e.target, 0.1, { left: p.left, top: p.top, x: 0, y: 0, }); My blocks seem to disregard this, I don't fully understand how to make one element "tween" ontop of another one. the values my console log provide seem accurate but it does nothing in draggable/gsap, it only remains on the spot I left it. Any advice? Thanks, See the Pen PoWLJJQ by lsencabaugh (@lsencabaugh) on CodePen Edited April 26, 2021 by cpkn_dev New codepen Link to comment Share on other sites More sharing options...
Solution OSUblake Posted April 26, 2021 Solution Share Posted April 26, 2021 Here's an pen using an older version of gsap, but the logic is still relevant. See the Pen rZOGZy by osublake (@osublake) on CodePen 6 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now