How to capture the click and drag of a DOM object

Asked

Viewed 217 times

0

I have a div that wants to fire a function if the user clicks and drags. A div can be positioned in different places on the grid. I use the gridStack plugin. I want to get the final position of the div inside the grid.

A DOM object with gridStack is:

<div data-gs-x="0" data-gs-y="0" data-gs-width="4" data-gs-height="4" class="grid-stack-item ui-draggable ui-resizable ui-resizable-autohide"> </div>

The data-Gs-x="0" data-Gs-y="0" attributes inform the position within the grid. Is there any event that captures the position of the object after clicking and dragging?

  • I don’t know the plugin, but is there any event when you move the Div? You can capture in it.

  • What would be the click and drag event? Any suggestions?

  • I once used sortable. https://jqueryui.com/sortable/

  • Estás urls a presentão uma serie de demostrações http://troolee.github.io/gridstack.js/demo/ http://troolee.github.io/gridstack.js/demo/serialization.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.