javascript - How to drag & drop text within contenteditable div with jQuery UI -


i'm trying move draggable text in div contenteditable.

this div:

<div class="droppable_tag" contenteditable="true">facebook shuts down friends data <a contenteditable="false" class="draggable_tag">api</a> generate more trust among users</div> 

the goal have text (in case "api") reinsert contenteditable div once it's been dropped @ place it's been dropped. i've tried getting value of div don't know how insert draggable it.

this code: https://jsfiddle.net/gslq7cxy/1/

any appreciated!

you're better off using sortable method instead; has of properties of draggable, reorders items based on item dropped.

you'll need wrap each word in element span (see this post solution) , make parent sortable: $( ".droppable_tag" ).sortable();.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -