我正在使用http://johnny.github.io/jquery-sortable/对于我的表格,以便拖动和排序元素。 但是当我开始拖动项目时,我在显示红色箭头时遇到问题。红色箭头好像不见了...这里有人知道如何显示它吗?
这是我迄今为止尝试过的 JavaScript 代码:
$(document).ready(function () {
$('.sorted_table').sortable({
containerSelector: 'table',
itemPath: '> tbody',
itemSelector: 'tr',
placeholder: '<tr class="placeholder"/>'
});
});
这是相关的 html:
<table id="listOfFile" class="table table-hover sorted_table">
<thead class="head">
<tr>
<td class="filename">File name</td>
<td class="type">Type</td>
<td class="detail">Details</td>
<td class="status">Status</td>
<td></td>
</tr>
</thead>
<tbody class="body">
</tbody>
</table>
最佳答案
您需要添加样式......如下所示:
/** Define arrowhead **/
.sorted_table tr.placeholder:before {
content: "";
width: 0;
height: 0;
margin-top: -5px;
left: -5px;
top: -4px;
border: 5px solid transparent;
border-left-color: red;
border-right: none;
}
关于javascript - Jquery-sortable 不显示红色箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26460950/