jQuery addClass example
Change class name on click in jQuery
by booktu8
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/jsplumb.min.js"></script>
<div id="diagramContainer">
<div id="item_left" class="item"></div>
<div id="item_right" class="item" style="margin-left:50px;"></div>
</div>
CSS
#diagramContainer {
padding: 20px;
width: 80%;
height: 200px;
border: 1px solid gray;
}
.item {
height: 80px;
width: 80px;
border: 1px solid blue;
float: left;
}
JavaScript
/* global jsPlumb */
jsPlumb.ready(function () {
jsPlumb.setContainer('diagramContainer')
var common = {
isSource: true,
isTarget: true,
connector: ['Straight']
}
jsPlumb.addEndpoint('item_left', {
anchors: ['Right'],
allowLoopback:false,
}, common)
jsPlumb.addEndpoint('item_right', {
anchor: 'Left',
allowLoopback:false,
}, common)
jsPlumb.addEndpoint('item_right', {
anchor: 'Right',
allowLoopback:false,
}, common)
jsPlumb.makeTarget("Right", {
allowLoopback:false
});
jsPlumb.makeTarget("Left", {
allowLoopback:false
});
})