How can I control the animation and transformation of the dragged item in response to mouse-movement? (e.g. physics-aware dragging, gravity, pendulum swings, etc) #2027
-
I'm using SortableJS to allow users to drag items between lists - just like Trello. I'm wanting to add a subtle kinetic effect to dragging, so that dragging items faster would make them "swing" or otherwise act like a pendulum in response to mouse movement. (Don't worry, I'm not asking how to do the mathematics to implement that). The problem is I'm using SortableJS' own animation code, which overwrites the transformation matrix in It doesn't look like there's any hooks or way to get my own code to run inside SortableJS' Assuming what I'm asking is possible, what other approaches could be used? Also, I noticed that SortableJS isn't using CSS/DOM animations, instead it's manually animating itself via |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
@Jehoel Just to clarify - Are you talking about adding this kinetic effect to the ghost (the element that moves with the mouse) or the actual elements in the list that are swapped around as you drag? |
Beta Was this translation helpful? Give feedback.
@Jehoel Just to clarify - Are you talking about adding this kinetic effect to the ghost (the element that moves with the mouse) or the actual elements in the list that are swapped around as you drag?