Une façon de définir la position d'ancrage terminal utilise les paramètres par défaut jsPlumb comme:
jsPlumb.importDefaults({
PaintStyle : {lineWidth:1,strokeStyle:color2},
Connector: ["Straight"],
Anchor:"Continuous" // dymamically nearest position will be considered for endpoint
//OR
Anchor:["Top","Bottom"] // only top or bottom center whichever is near will be considered as endpoints
//OR
Anchor:["Left","Right"] // similarly left or right center will be considered
});
peut également déclarer au moment de la connexion comme:
jsPlumb.connect({
source:someDiv,
target:someOtherDiv,
anchors:["Bottom", "Continuous"] // Bottom nearest point will be considered
});
Pour maketarget et makeSource déclarent comme:
jsPlumb.makeSource(someDiv, {
anchor:"Continuous",
paintStyle:{ fillStyle:"red" }
});
Ou au moment de l'ajout du point de terminaison déclarez:
jsPlumb.addEndpoint(someDiv, {
anchor:"Continuous",
paintStyle:{ fillStyle:"red" }
});