JQuery UI: setting drag-and-drop options for a dialog

I have a drag and drop dialog, and I would like to set the drag and drop options, I do not know how to do this.

Here is an example. In the red box there is a cursorAt option with { top: 0, left: 0 } . I would like to do the same with drag and drop dialog.

+6
source share
2 answers

To change the drag and drop options of a dialog box widget, you can refer to it as follows:

 $("#myDialog").dialog("widget").draggable("option", "cursorAt", { top: 0, left: 0 }); 

You can do the same with resizing options.

+7
source

Just add the drag and drop to the dialog:

 $("#draggable, #dialog").draggable({ cursorAt: { top: 0, left: 0 } }); 

You can set properties that you can drag to any item that you can drag.

0
source

Source: https://habr.com/ru/post/886159/


All Articles