【发布时间】:2023-03-30 18:30:02
【问题描述】:
所以我正在用 JS (+jQuery) 制作国际象棋游戏,最后要做的就是让棋子可拖动。
我的板是常规的 html 表(带有 TR 和 TD),其中 DIV 包含片段。 我正在使用 jQuery UI 使 DIV 可拖动,但每次我尝试将带有一块的 DIV 拖动到其他位置时,它都会保持在同一个 td 中: http://screenshooter.net/8964979/Klpmu17_06_02_2014__12_38_17
HTML 是这样的:
<table>
<tr>
<td class="pole">
<div class="figura">here goes a piece</div>
</td>
<td class="pole">
...
</td>
</tr>
<tr>
...
</tr>
</table>
然后是JS:
$(".figura").draggable({
revert: true,
appendTo: 'body',
stack: '.pole',
start: function () {
$('#tabs').css('z-index', '9999');
},
stop: function () {
$('#tabs').css('z-index', '0');
}
});
$(".pole").droppable();
我怎样才能让他们走出牢房?
【问题讨论】:
标签: jquery html-table cell draggable behind