在js中,调用sortable时,常常要改变元素位置。假如数组名称为elements,需要改变元素的个数为c,则改变元素位置的代码如下:
elements.splice.apply(
elements, [new_position, 0].concat(
elements.splice(original_position, c)
))
在js中,调用sortable时,常常要改变元素位置。假如数组名称为elements,需要改变元素的个数为c,则改变元素位置的代码如下:
elements.splice.apply(
elements, [new_position, 0].concat(
elements.splice(original_position, c)
))