我动态创建了一个jsPlump图
jsPlumb.ready(function(){
jsPlumb.setContainer('row');
var endPointLeft = {
maxConnections : 1,
onMaxConnections: function(info, e){
alert('Max. 1');
},
connector: ['Straight'],
anchor: 'Right',
endpoint: 'Dot',
isSource: true,
isTarget: true
};
var endPointRight = {
maxConnections : 1,
onMaxConnections: function(info, e){
alert('Max. 1');
},
connector: ['Straight'],
anchor: 'Left',
endpoint: 'Dot',
isSource: true,
isTarget: true
};
jsPlumb.addEndpoint($('.leftTree tbody').children().filter('.left'), {}, endPointLeft);
jsPlumb.addEndpoint($('.rightTree tbody').children().filter('.right'), {}, endPointRight);
// delete connection when clicked on
jsPlumb.bind('click', function (connection, e) {
jsPlumb.detach(connection);
});
});
但每次我连接两个点时,都会出现以下错误"错误:< svg>的值无效属性width =" -Infinity" "和"错误:< svg>的值无效属性height =" -Infinity""。
有人知道如何修复它吗?