javascript - Jquery-sortable 不显示红色箭头

标签 javascript jquery jquery-ui-sortable

我正在使用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/

相关文章:

php - 表单提交上的成功/错误消息未显示

javascript - 我有两个不能一起工作的 javascript 文件

javascript - 获取某个div下给定类的元素,并获取每个值

javascript - 如何在移动浏览器的嵌入式 Vimeo 播放器上显示全屏按钮?

javascript - 根据原型(prototype)中的 URL 隐藏/显示 <div>

javascript - 视口(viewport)高度差中断滚动事件

javascript - 如何使用post方法(AJAX)调用异常?

jquery-ui - 在 angular-ui 可排序的列表中处理项目的移动?

javascript - 对可排序列表进行排序

jquery - 从 jquery 可排序中删除 div