有人会非常友好地告诉我如何在jsPlumb中更改锚点的形状吗? 我想在盒子的左侧和右侧有半圆作为锚点。
问题似乎是让锚点使用CSS来形成它们。
的jsfiddle:
http://jsfiddle.net/2uvy1uju/11/
您可以忽略以下代码: JS:
var startpointOptions = {isSource: true, anchor: "RightMiddle", endpoint: ['Rectangle', {width: 40, height: 40, cssClass: "outArc"}], paintStyle: {fillStyle:"red"}};
var endpointOptions = {isTarget: true, anchor: "LeftMiddle", endpoint: ['Dot', {radius: 20, cssClass: "inArc"}], paintStyle: {fillStyle:"blue"}};
var startpoint = jsPlumb.addEndpoint($('#theDiv'), startpointOptions);
var endpoint = jsPlumb.addEndpoint($('#theDiv'), endpointOptions);
CSS:
.inArc {float:left; background-color: darkblue; height: 40px; width: 20px; border-radius: 0 20px 20px 0; margin-top:30px;}
.outArc {float:right; background-color: darkred; height: 40px; width: 20px; border-radius: 20px 0 0 20px; margin-top:30px;}
像这样: