Jquery Draggable AND Resizable

前端 未结 6 542
终归单人心
终归单人心 2020-12-01 08:03
function makeResourceDrag(arrIndexID) {

    $(\'#imgA\' + arrIndexID).resizable();

    $(\'#imgA\' + arrIndexID).draggable({
        start: function(event, ui) {
          


        
6条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 08:51

    If you apply the resizable first, you can then apply the draggable to the img's parent; which is the new div created by applying resizable.

    chartImg.resizable({ animate: true,
                ghost: true,
                handles: 'n,s,e,w,ne,se,nw,sw',
                start: function (event, ui) { startResize(event, ui); },
                resize: function (event, ui) { monitorResize(event, ui); },
                stop: function (event, ui) { stopResize(event, ui); }
            }).parent().draggable({ containment: $(".chartPane") });
    

提交回复
热议问题