Jump to content
Search Community

MSD

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by MSD

  1. Ah I found the perfect solution: On the client side I captured the velocity of x and y and saved this to the db. On the serverside I use ThrowPropsPlugin.to() to create the exact same animation. Hope this helps someone. ----- EDIT ----- Just some further remarks as I have been fiddling around with this for a couple of more hours: The solution described above worked as expected with one little issue: On the client side the square was inside a div which marked the boundary for the Draggable instance. As far as I know you can't apply these boundaries to the ThrowPropsPlugin.to() method so you have to do a little math. Calculate the top and left offset of the boundary div on the serverside Calculate width and height of the boundary div on the serverside Apply these values to the min/max options of x and y values in the ThrowPropsPlugin.to() method on the serverside The velocity calculated on the client side (on DragEnd callback) creates a more "forcefully" animation if directly applied on the serverside. I think it has something to do with the Draggable boundary implementation but I can't find much information on this. What I did was setting the resistance until it felt right. Cheers, Florian.
  2. Hi there, I'm trying to create a web app which let's the user move a square around inside a container on his smartphone / tablet and be able to move a square on his desktop. This is, at the current state, accomplished by saving the interaction to a databse via ajax (from the device) and reading for pending actions from the database on the desktop site. Moving elements via arrow works just fine, because the steps are fixed. I'm just wondering if it would be possible to trigger more advanced things like Draggable with ThrowPopsPlugin. If I'm understanding the docs right, I'm able to trigger Draggable by hand via the startDrag() function but I have to pass the original event. This would be not possible since I'm not able to pass the event from the third party device to the db and further on to the desktop site. Is there a way to "simulate" such an event on the desktop site, fill it with the neccessary data (pageX, pageY, etc.) and trigger it? Your help is much appreciated. Thanks in advance! Kind regards, Florian.
×
×
  • Create New...