我正在尝试在两个端点之间的JSPlumb中创建一个直线连接。 当我尝试连接到端点时,拖动源点而不是创建直线连接。
这里的小提琴: http://jsfiddle.net/dutchman71/aMksZ/2/
任何帮助表示感谢。
var endpointOptions = {
anchor:"BottomCenter",
maxConnections:1,
isSource:true,
isTarget:true,
endpoint:["Dot", {radius:5}],
paintStyle:{fillStyle:"#5b9ada"},
connectorStyle : { lineWidth: 3, strokeStyle:"#5b9ada" },
connector : new jsPlumb.Connectors.Straight(),
setDragAllowedWhenFull:true,
connectorOverlays:[
[ "Arrow", { width:20, length:30, location:1, id:"arrow" } ],
[ "Label", { label:"", id:"label" } ]
]
}
jsPlumb.bind("ready", function() {
jsPlumb.addEndpoint('block1', endpointOptions);
jsPlumb.addEndpoint('block2', endpointOptions);
jsPlumb.draggable('block1');
jsPlumb.draggable('block2');
});
答案 0 :(得分:7)
是的,所以我似乎找到了答案(见docs)。替换此行:
connector: new jsPlumb.Connectors.Straight()
这一行:
connector: ["Straight"]