我正在尝试使用jsPlumb 1.3.16来执行以下操作。 1.将端点添加到两个div 2.以编程方式创建连接(请参见下文)。JsPlumb以编程方式创建连接隐藏端点
我遇到的问题是,连接似乎创建了它自己的端点,它们现在隐藏了原始端点。因此,我无法从这些端点创建更多的连接。这似乎是一个Z指数的问题。
任何人都可以帮忙吗?
var connectorOptions = {
uniqueEndpoint:false,
maxConnections:-1,
newConnection:true,
endpoint: ["Rectangle", {
width: 15,
height: 15
}],
endpointStyle: {
fillStyle: "rgba(255,255,255,50)",
outlineColor: "#ccc",
outlineWidth: 1
},
setDragAllowedWhenFull: true,
connector: ["Straight"],
paintStyle: {
strokeStyle: "#ec51bb",
lineWidth: 4
},
connectorStyle: {
lineWidth: 4,
fillStyle: "#ec51bb"
},
overlays: [
["Arrow", {
width: 14,
length: 14,
foldback: 1,
location: 1,
id: "arrow"
}]
]
};
var endpointOptions = {
maxConnections:-1,
uniqueEndpoint:false,
isSource:true,
isTarget:true,
endpoint:["Rectangle", {
width:15,
height:15,
cssClass: "endPointStyle",
hoverClass: "endPointHoverStyle"
}],
setDragAllowedWhenFull:true,
paintStyle:{
strokeStyle: "#9f9f9f"
},
connectorStyle : {
lineWidth: 4,
strokeStyle:"#ec51bb"
},
connector:[ "Straight"],
connectorOverlays:[
[ "Arrow", {
width:14,
length:10,
foldback: 1,
location:1,
id:"arrow"
} ],
[ "Label", {
label:"",
id:"label"
} ]
]
};
jsPlumb.addEndpoint(itemId1,{ anchor:[ 0.5, -0.05, 0, 1, 0, -4 ] }, endpointOptions);
jsPlumb.addEndpoint(itemId2,{ anchor:[ 0.5, -0.05, 0, 1, 0, -4 ] }, endpointOptions);
var anchors= [[ 0.5, -0.05, 0, 1, 0, -4 ], [ 0.5, -0.05, 0, 1, 0, -4 ]];
var newConnection = jsPlumb.connect({
source: itemId1,
target: itemId2,
anchor: anchors
},
connectorOptions
);
什么是你的创造元素之间的连接的声明? 您可以在创建端点时尝试选项**锚点**,并使其连续,以便端点不重叠。 '主播: “连续”' – MrNobody