JQuery drag and drop ul and li elements

On the one hand, I got a list of <ul> and <li> . The <ul> and <li> elements should be dragged. The target is a div or span . How could I start?

+4
source share
3 answers

Basically, your draggable items will be <li> , and your droppable will be <div> or <span> or both. Set the necessary parameters for both draggable and droppable. After that, handle the drag event of the draggable and drop object for droppable to execute any custom functions. Check quotation marks using the accept droppable option (this is either a selector or a function). Here is the necessary documentation:

Draggable: http://jqueryui.com/demos/draggable/

Droppable: http://jqueryui.com/demos/droppable/

jsFillde: fiddle

+5
source

Ok this will give you a start

JQuery UI droppable

+2
source

Use the jQueryUI documentation: http://jqueryui.com/demos/

For your question: http://jqueryui.com/demos/draggable/#sortable

-1
source

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


All Articles