jsplumbb -端点在刷新后的坏位置,鼠标悬停后,他们得到良好的位置

jsPlumb - bad position of endpoints after refresh and after mouseover they get to good position

本文关键字:位置 他们 悬停 鼠标 端点 jsplumbb 刷新      更新时间:2023-09-26

我有一个jsplump端点的问题。站点刷新后,端点的位置不在可拖动元素上,而是在站点的其他位置。但是鼠标移过之后,它们会跳到合适的位置。我也不知道为什么。初始元素的绝对位置由left和top css属性设置。

可拖动元素:

<div class="window" id="flowchartWindow5"></div>
<div class="window" id="flowchartWindow1"><strong>1</strong></div>
<div class="window" id="flowchartWindow2"><strong>2</strong></div>
<div class="window" id="flowchartWindow3"></div>
<div class="window" id="flowchartWindow4"></div>

如果没有实际的代码,很难说为什么元素放错了位置,但是您可以尝试在页面加载后重新绘制连接,因为元素可能在初始连接后被移动了。在JS的末尾或页面加载之后包含以下代码:

jsPlumb.repaintEverything();

为了帮助你更好地包括jsFiddle链接!