2013-02-03 56 views
2

我有一段時間,jsPlumb嘗試從同一個源錨點創建兩個連接。jsplumb:從同一個源錨點創建兩個連接

例如,在下面的jsfiddle我試圖創建從塊1錨兩個連接到其他兩個區塊2和3 http://jsfiddle.net/dutchman71/TYerW/3/

出於某種原因,在jsPlumb例子正常工作在這裏與綠點錨點。 http://jsplumb.org/jquery/draggableConnectorsDemo.html#

有誰能告訴我我失蹤了什麼嗎?

  var endpointOptions = { 
        anchor:"BottomCenter", 
        maxConnections:-1, 
        isSource:true, 
        isTarget:true, 
        endpoint:["Dot", {radius:6}], 
        setDragAllowedWhenFull:true, 
        paintStyle:{fillStyle:"#5b9ada"}, 
        connectorStyle : { lineWidth: 4, strokeStyle:"#5b9ada" }, 
        connector:[ "Bezier", { curviness:1 }], 
        connectorOverlays:[ 
         [ "Arrow", { width:15, length:15, location:1, id:"arrow" } ], 
         [ "Label", { label:"", id:"label" } ] 
        ]    
        } 

      jsPlumb.bind("ready", function() { 

        jsPlumb.addEndpoint('block1', endpointOptions); 

        jsPlumb.addEndpoint('block2', endpointOptions); 

        jsPlumb.addEndpoint('block3', endpointOptions); 

        jsPlumb.draggable('block1'); 
        jsPlumb.draggable('block2'); 
        jsPlumb.draggable('block3'); 
      }); 

回答

0

將maxconnections設置爲正整數。應該這樣做。

也許你應該讓你的端點更大,並給連接線一個比enpoints更小的z-index,這樣你就不會錯過畫布而不是div (畫布幾乎阻擋整個div塊1之後的連接被建立到塊/ 2檢查它在你的元件檢查/螢火蟲等)

0

更改端點的半徑到端點

[「點」,{半徑:1}],

and connectorStyle line width to 1

connectorStyle:{lineWidth:4,strokeStyle:「#5b9ada」}