gpt4 book ai didi

jquery-ui 可排序 "overlapping"问题

转载 作者:行者123 更新时间:2023-11-28 02:15:12 26 4
gpt4 key购买 nike

我正在使用 jquery ui 的可排序函数和几个连接的列表。这些列表包含在可拖动、可调整大小的 div 中,div 上带有“overflow: auto”。当我将一个包含大量列表项 (‹li›) 的 div 放在另一个之上时,我遇到了这个问题。

enter image description here

Top div 包含很多 li 元素,这意味着它实际上比实际显示的要低得多。这意味着当我移动底部 div 中的一个元素时,该元素将在顶部 div 的可排序列表(这不应该发生,因为它是隐藏的)和底部 div 的可排序列表之间跳转,使其在两者之间闪烁。

这是一个主要问题,因为用户很难将 li 放在正确的 div 中,如果他/她是这样放置他们的 div 的。

我想要的是 li 仅连接到当前悬停在哪个 div 上的列表。

有人知道怎么解决吗?

技术细节

以底部div为例:

<div style="height: 310px; width: 200px; z-index: 14; left: 909px; top: 215px; position: absolute;" class="Category ui-draggable ui-resizable p-resize-snap" id="cat883">
<input type="hidden" value="310" id="hiddenHeight883" name="ctl00$MainContentPlaceHolder$hiddenHeight883"><div style="height: 20px;" class="CategoryHeader">
<table style="table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><a onclick="return ToggleLinks(&quot;883&quot;);" href="#">^</a></td><td class="categoryNameTD"><span class="categoryName">Games </span><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbxCat883" id="cbxCat883"></span></td><td style="width: 16px;"><a onclick="return Edit();" href="#">E</a></td>
</tr>
</tbody></table>
</div><div style="height: 274px; overflow: auto; border-bottom: 1px dotted rgb(221, 221, 221);" id="catLinks883">
<div class="CategoryLinks">
<ul style="list-style-type: none; margin: 0px; padding: 0px;" class="drpList ui-sortable"><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://www.youtube.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://www.youtube.com/" title="Youtube">Youtube</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx722" id="cbx722"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://www.metacritic.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://www.metacritic.com/" title="Metacritic - Movie Reviews, TV Reviews, Game Re...">Metacritic - Movie Reviews, TV Reviews, Game Re...</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx710" id="cbx710"></span></td>
</tr>
</tbody></table>
</div></li><li style="display: list-item;"><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://www.myspace.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://www.myspace.com/" title="MySpace">MySpace</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx725" id="cbx725"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://www.fz.se/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://www.fz.se/" title="FZ">FZ</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx707" id="cbx707"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://n4g.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://n4g.com/" title="N4G.com : All the latest game news">N4G.com : All the latest game news</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx708" id="cbx708"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://www.facebook.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://www.facebook.com/" title="Facebook">Facebook</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx724" id="cbx724"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://www.quakelive.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://www.quakelive.com/" title="QUAKE LIVE">QUAKE LIVE</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx713" id="cbx713"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://lifehacker.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://lifehacker.com/" title="Lifehacker, tips and downloads for getting thin...">Lifehacker, tips and downloads for getting thin...</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx721" id="cbx721"></span></td>
</tr>
</tbody></table>
</div></li><li style=""><div class="drpLink">
<table style="width: 100%; table-layout: fixed;">
<tbody><tr>
<td style="width: 16px;"><img style="height: 16px; width: 16px;" alt="@" src="http://quicksilverscreen.com/favicon.ico"></td><td style="overflow: hidden; white-space: nowrap;"><a target="_blank" href="http://quicksilverscreen.com/" title="http://quicksilverscreen.com/">http://quicksilverscreen.com/</a></td><td style="width: 16px;"><span style="display: none;"><input type="checkbox" name="ctl00$MainContentPlaceHolder$cbx723" id="cbx723"></span></td>
</tr>
</tbody></table>
</div></li></ul>
</div>
</div>
<div class="ui-resizable-handle ui-resizable-e"></div><div class="ui-resizable-handle ui-resizable-s"></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 1001;"></div></div>

更新:

初始化:我已经尝试使用 helper: 'clone', appendTo: "several different elements including body"和 zIndex: 10000 但它们都没有帮助我。

我希望 appendTo 属性实现的是使 li 可放入我的“.Category”(的可视部分),即包含列表的 div。

$(".drpList").sortable({ handle: ".drpLink img", connectWith: ".drpList", tolerance: "pointer" });

最佳答案

这似乎是可排序列表的错误,我遇到过类似的问题。

这个解决方案对我有用。

Dealing with overlapping jQuery sortable lists

关于jquery-ui 可排序 "overlapping"问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5204047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com