【问题标题】:Unable to create straight line connection in JSPlumb无法在 JSPlumb 中创建直线连接
【发布时间】:2013-02-02 12:56:32
【问题描述】:

我正在尝试在 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');
            });

【问题讨论】:

    标签: jsplumb


    【解决方案1】:

    是的,看来我可能已经找到了答案(请参阅docs)。替换这一行:

    connector: new jsPlumb.Connectors.Straight()
    

    用这一行:

    connector: ["Straight"]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-16
      • 2022-01-25
      • 1970-01-01
      • 1970-01-01
      • 2016-11-02
      • 1970-01-01
      • 2015-05-08
      相关资源
      最近更新 更多