How can I enable 'draggable' on a element with contentEditable?

前端 未结 4 2086
刺人心
刺人心 2020-12-09 13:21

I\'d like to have a div that is at the same time editable and draggable, using jQuery UI. Content editability seems to work only if draggable is not enabled. Am I missing so

4条回答
  •  情歌与酒
    2020-12-09 14:11

    you can give this div a 'parent div' and add draggable event to it parent. then use offical API 'cancel'

    HTML:

    TEXT

    JS:

     $('#draggable').draggable({cancel: '.editable'});
    

提交回复
热议问题