jsPlumb source endpoint does not move when source container is dragged

前端 未结 1 1627
没有蜡笔的小新
没有蜡笔的小新 2021-01-14 18:35

Using jsPlumb, where bonds are created between subdivs that are inside draggable absolute positioned containers called .projects. These all appear

1条回答
  •  太阳男子
    2021-01-14 18:41

    To update connections of child(DIV) elements you need to make use of customised jQuery draggable instead of jsPlumb.draggable. Here is the customised jQuery draggable for your code:

    newAgent.draggable({
            containment: 'parent',
            drag:function(e){
                $(this).find('._jsPlumb_endpoint_anchor_').each(function(i,e){ 
                    if($(e).hasClass("connect"))
                        jsPlumb.repaint($(e).parent());
                    else
                        jsPlumb.repaint($(e));
                });                                     
            }
        });
    

    Updated Fiddle

    0 讨论(0)
提交回复
热议问题