我正在开发Drag‘n’Drag接口。一切正常。我需要一些额外的功能帮助。
我有3列拖拽的项目。每件商品都有一个标题号: 1,2,3,...我想要更改面板标题中的数字,以反映面板在列中的顺序(因此,如果您将面板拖到顶部,它将变为1,而它下面的面板将变为2、3等等)。
发布于 2011-10-07 01:08:59
这是你想要的吗?
$( ".content .draggable-area" ).sortable({
connectWith: ".draggable-area",
tolerance: "pointer",
cursor: "move",
cursorAt: {top: 10, left: 10},
distance: 30,
opacity: 0.8,
stop: function(event, ui) {
$('.draggable-area').each(function(){
$(this).find('.draggable-box').each(function(){
$(this).find('h2').html($(this).index()+1);
});
});
}
});演示:
http://jsfiddle.net/Xr3ne/1/
https://stackoverflow.com/questions/7677738
复制相似问题