Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery UI可排序占位符样式设置问题_Jquery_User Interface_Jquery Ui Sortable_Placeholder - Fatal编程技术网

JQuery UI可排序占位符样式设置问题

JQuery UI可排序占位符样式设置问题,jquery,user-interface,jquery-ui-sortable,placeholder,Jquery,User Interface,Jquery Ui Sortable,Placeholder,我一直在为一个朋友想办法解决这个问题。他们有一个HTML5本地音乐播放器,允许用户拖放播放列表中的项目。但是,占位符的颜色没有显示出来,其他元素包括高度和线条高度。这是JSFiddle,您可以看到我在说什么:提前感谢您的帮助。试试下面的方法。这是因为占位符是一个空行。只需在其中添加td HTML JS $('songlisttbody')。可排序({ 他说:对,, 不透明度:0.6, 卷轴:没错, 包含:'父', 占位符:“ui占位符”, 公差:“指针”, “开始”:函数(事件、用户界面){

我一直在为一个朋友想办法解决这个问题。他们有一个HTML5本地音乐播放器,允许用户拖放播放列表中的项目。但是,占位符的颜色没有显示出来,其他元素包括高度和线条高度。这是JSFiddle,您可以看到我在说什么:提前感谢您的帮助。

试试下面的方法。这是因为占位符是一个空行。只需在其中添加
td

HTML

JS

$('songlisttbody')。可排序({
他说:对,,
不透明度:0.6,
卷轴:没错,
包含:'父',
占位符:“ui占位符”,
公差:“指针”,
“开始”:函数(事件、用户界面){
ui.placeholder.html(“”)
}
}).disableSelection();

尝试以下操作。这是因为占位符是一个空行。只需在其中添加
td

HTML

JS

$('songlisttbody')。可排序({
他说:对,,
不透明度:0.6,
卷轴:没错,
包含:'父',
占位符:“ui占位符”,
公差:“指针”,
“开始”:函数(事件、用户界面){
ui.placeholder.html(“”)
}
}).disableSelection();
<table id="songList">
<thead>
    <tr>
        <th id="check"><input type="checkbox" title="Select All"></th>
        <th id="delete"><button title="Delete Selected"></button></th>
        <th id="play"><button></button></th>
        <th id="artist" style="width: 296px; ">Artist</th>
        <th id="title" style="width: 296px; ">Title</th>
        <th id="album" style="width: 297px; ">Album</th>
    </tr>
</thead>
<tbody style="height: 204px; " class="ui-sortable"><tr class="ui-state-default playing"><td class="check"><input type="checkbox"></td><td class="delete"><button title="Delete From List"></button></td><td class="play"><button></button></td><td class="artist" style="width: 296px; ">Masakazu Sugimori</td><td class="title" style="width: 296px; ">Ace Attorney ~ Prologue</td><td class="album" style="width: 280px; ">Phoenix Wright - Ace Attorney OST</td></tr><tr class="ui-state-default"><td class="check"><input type="checkbox"></td><td class="delete"><button title="Delete From List"></button></td><td class="play"><button></button></td><td class="artist" style="width: 296px; ">Masakazu Sugimori</td><td class="title" style="width: 296px; ">Reminiscence ~ Case DL-6</td><td class="album" style="width: 280px; ">Phoenix Wright - Ace Attorney OST</td></tr><tr class="ui-state-default"><td class="check"><input type="checkbox"></td><td class="delete"><button title="Delete From List"></button></td><td class="play"><button></button></td><td class="artist" style="width: 296px; ">Masakazu Sugimori</td><td class="title" style="width: 296px; ">Rise From The Ashes ~ End</td><td class="album" style="width: 280px; ">Phoenix Wright - Ace Attorney OST</td></tr></tbody>
</table>
table input[type=checkbox], table button {
    border: none;
    margin: 0;
    padding: 0;
    width: 13px;
    height: 13px;
    position: relative;
    top: 1px;
}

table {
    border-spacing: 0;
    width: 100%;
}
$('#songList tbody').sortable({
    refreshPositions: true,
    opacity: 0.6,
    scroll: true,
    containment: 'parent',
    placeholder: 'ui-placeholder',
    tolerance: 'pointer',
    'start': function (event, ui) {
        ui.placeholder.html("<td colspan='6'></td>")
    }
}).disableSelection();