如何使用 jsPlumb 在两个对象之间绘制两条不同的线
我有两个div,Div1和Div2,我想画两条线,例如Div1到Div2和Div2到Div1。我正在使用 jsPlumb for jquery 来绘制连接器。它只绘制一条带有箭头的线,表明它是双向的。要求是显示两条不同的线。在 jsPlumb 中有什么方法可以做到这一点吗?
I have a two divs, Div1 and Div2, I want to draw two lines like Div1 to Div2 and Div2 to Div1. I am using jsPlumb for jquery to draw the connector. It draws only one line with arrow indicating it is bidirectional. The requirement is to show two different lines. Is there any way to do that in jsPlumb?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您对两个连接使用相同的锚点,因此两个连接被绘制在彼此之上。
在 jsPlumb 1.3.3 之前,解决这个问题的方法是显式设置不同的锚点,如下所示:(
如果您使用 jsPlumb.addEndpoint,则适用相同的原则)。
在版本 1.3.4 中,我将发布“连续”锚点,这些锚点确保它们在每个元素上都有自己的位置,并且是专门针对您遇到的问题而设计的,因为像上面的示例一样设置所有内容都会很无聊迅速地。
1.3.4 应该会在一周后发布。
it sounds like you're using the same Anchor point for both connections, so the two connections are being painted on top of each other.
up to jsPlumb 1.3.3 the way to get around this is to explicitly set different anchor points, something like this:
(If you're using jsPlumb.addEndpoint the same principle applies).
In version 1.3.4 I will be releasing "Continuous" anchors, which are anchors that ensure they get their own location on each element, and were designed specifically for the issue you're having, because setting everything up like that example above gets boring quickly.
1.3.4 should be released in about a week from now.