How to make a div contenteditable and draggable

jquery, jquery-ui

Solution

$("#d").draggable()
  .click(function() {
    $(this).draggable({ disabled: false });
}).dblclick(function() {
    $(this).draggable({ disabled: true });
});
​​

DEMO

Problem

``` <div contenteditable="true" id="d"> <span>Text to edit</span> </div> $("#d").draggable(); ``` I can only drag this div but how can i edit it (like on doubleclick editable property become active and on click dragging become active)?

Original source

Related problems