I created a very simple setup with jsplumb that displays the top item and then connects that item to six others on the screen.
I am wondering if it is possible to animate connecting lines so that they seem to grow from the top element, and not just appear.
Here is the code I copied to create a simple layout.
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"}); });
The CSS I use is as follows:
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; }
And the contents of the body section of my html looks like this:
<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>
I would like the connectors to “grow” from starterPoint to each of the window elements below.
I am VERY new to using jsplumb and I cannot find much information there.
thanks