Javascript Jquery可排序。调整选定/拖动的CSS
使用jquerysortable。我想做一个简单的css切换功能,这样我就可以更改我选择的字段的背景颜色(Javascript Jquery可排序。调整选定/拖动的CSS,javascript,jquery,html,css,jquery-ui-sortable,Javascript,Jquery,Html,Css,Jquery Ui Sortable,使用jquerysortable。我想做一个简单的css切换功能,这样我就可以更改我选择的字段的背景颜色(查看中的事件start和stop。通过使用它们,您只需在当前拖动的元素中添加或删除所需的类。通过 $(ui.item).doStuff(); 其中,ui当然是事件回调参数的第二个 $(document).ready(function () { $("#reorder-list").sortable({ placeholder: "destination",
查看中的事件start
和stop
。通过使用它们,您只需在当前拖动的元素中添加或删除所需的类。通过
$(ui.item).doStuff();
其中,ui
当然是事件回调参数的第二个
$(document).ready(function () {
$("#reorder-list").sortable({
placeholder: "destination",
forcePlaceholderSize: true,
handle: '.handle',
update: function () {
var order = $('#reorder-list').sortable('serialize');
$("#info").load("billboard-sort.php?" + order);
}
});
});
.bar-across {
background:#fff;
border:1px solid #ccc;
margin-bottom:5px;
width: 100%;
}
#reorder-list div .handle {
cursor: move;
padding:0;
float:left;
background:#0C6;
padding: 10px;
}
.destination {
background:#1c5dbb;
width: inherited;
}
.selected {
background:#FF0;
}
/* Clearfix
============================================================================ */
/* Clearfix */
.CF:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
.CF {
display:inline-block;
}
$(ui.item).doStuff();