jsPlumb端点编辑位置
问题描述:
使用jsPlumb处理项目我将静态连接器设置为两个地图标记。 jsplumb连接器的终点出现在地图标记图片上方,而我希望这些出现在下方。jsPlumb端点编辑位置
从哪里,在jsplumb JavaScript库中,我编辑端点的计算位置?设置终点支撑点位
答
一种方法是使用jsPlumb默认为:
jsPlumb.importDefaults({
PaintStyle : {lineWidth:1,strokeStyle:color2},
Connector: ["Straight"],
Anchor:"Continuous" // dymamically nearest position will be considered for endpoint
//OR
Anchor:["Top","Bottom"] // only top or bottom center whichever is near will be considered as endpoints
//OR
Anchor:["Left","Right"] // similarly left or right center will be considered
});
也可以声明在连接截至时间:
jsPlumb.connect({
source:someDiv,
target:someOtherDiv,
anchors:["Bottom", "Continuous"] // Bottom nearest point will be considered
});
对于makeTarget和makeSource声明为:
jsPlumb.makeSource(someDiv, {
anchor:"Continuous",
paintStyle:{ fillStyle:"red" }
});
或者在添加端点时声明为:
jsPlumb.addEndpoint(someDiv, {
anchor:"Continuous",
paintStyle:{ fillStyle:"red" }
});