mallanaga Posted May 14, 2020 Share Posted May 14, 2020 Hello there! I'm not entirely sure this has anything to do with gsap, but I don't know who else to ask. I'm working on an app to play cards, and broadcasting events. I won't bore you with those details. I use Draggable with the onDrag listener, then broadcasting the draggable's style.transform I pick up the changes with this: eventSource.addEventListener("cardPosition", (e) => { const data = JSON.parse(e.data), target = document.getElementById(data.message.id); target.style.transform = data.message.transform; }); This works, but the dom seems to be confused about the position of the element when grabbing it from another client. Attached is a gif showing an example. Link to comment Share on other sites More sharing options...
ZachSaucier Posted May 14, 2020 Share Posted May 14, 2020 Hey mallanaga. It's hard to say exactly what's going wrong based on that code alone. There's a similar thread that might be able to help? Besides that, it'd be helpful to have a reduced test case that we can test locally. Link to comment Share on other sites More sharing options...
mallanaga Posted May 14, 2020 Author Share Posted May 14, 2020 That link helped, thanks! Instead of setting style.transform, I used quickSetter to properly set the x and y position. Works great. 2 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