4
我創建了一個非常簡單的jsplumb設置,它顯示一個頂層元素,然後將該元素連接到屏幕上的其他六個元素。jsplumb動畫連接線
我想知道是否可以對連接線進行動畫處理,以使它們看起來像從頂部元素增長而不是僅僅出現。
這裏是我已經複製的代碼來創建簡單的佈局。
jsPlumb.ready(function() {
jsPlumb.importDefaults({
// notice the 'curviness' argument to this Bezier curve. the curves on this page are far smoother
// than the curves on the first demo, which use the default curviness value.
Connector : [ "Bezier", { curviness:50 } ],
PaintStyle : { strokeStyle:"#000000", lineWidth:6 },
EndpointStyle : { radius:1, fillStyle:"#000000" },
HoverPaintStyle : {strokeStyle:"#ec9f2e" },
EndpointHoverStyle : {fillStyle:"#ec9f2e" },
Anchors : [ "BottomCenter", "TopCenter" ]
});
jsPlumb.connect({source:"starterPoint", target:"window1"});
jsPlumb.connect({source:"starterPoint", target:"window2"});
jsPlumb.connect({source:"starterPoint", target:"window3"});
jsPlumb.connect({source:"starterPoint", target:"window4"});
jsPlumb.connect({source:"starterPoint", target:"window5"});
jsPlumb.connect({source:"starterPoint", target:"window6"});
});
我已經使用了CSS如下:
body
{
width: 960px;
margin: 0 auto;
}
#starterPoint
{
width: 8px;
height: 8px;
margin: 0 auto;
background-color:#000;
}
#window1, #window2, #window3, #window4, #window5, #window6
{
width: 100px;
height: 50px;
float: left;
margin-left: 50px;
margin-top: 70px;
background-color:#036;
}
而且我的HTML的主體部分的內容是這樣的
<div id="starterPoint"> </div>
<div id="window1"> </div>
<div id="window2"> </div>
<div id="window3"> </div>
<div id="window4"> </div>
<div id="window5"> </div>
<div id="window6"> </div>
我希望連接器「成長「從starterPoint到下面的每個窗口元素。
我很新的使用jsplumb我似乎無法找到很多資料在那裏它
感謝
連接器,paintStyle,endpointStyle,hoverPaintStyle,endpointHoverStyle和錨點應以小寫字母開頭。 – Yster
應該注意的是,這個答案中的代碼取自[jsplumb demo](https://github.com/sporritt/jsPlumb/blob/92bf8fdb1637528ac362500806cf749ffcabc7a7/demo/chart/demo.js),沒有任何歸屬。 –