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
Post a Comment