Skip to content Skip to sidebar Skip to footer

How Can I Connect Multiple Targets From A Single Source?

I am using this code to connect a single object one another object and this works fine. Could anybody help me to modify this to link a single object to multiple objects. var start

Solution 1:

Store all the id's of the target elements in an array and then you can loop the above code for your result:

var start = 'logo';
var end = ['link1','link2','link3',....];    

for(var i=0;i<end.length;i++){
    jsPlumb.connect({
        source:start,
        target:end[i],
        connector: [ "Flowchart", {cornerRadius:1} ],
        paintStyle:{
            lineWidth:5, strokeStyle:'#3E2522' },
        anchors: [[1.02, 0.5, 0, 1], [-0.02, 0.5, 0, 0]],
        endpointStyle: { radius:0.5 }
    })
}

Post a Comment for "How Can I Connect Multiple Targets From A Single Source?"