我已经为两列实现了 Nestable,拖放
http://dbushell.github.io/Nestable/
现在的问题是,如果一列的高度太长,第二列的高度太小,那么为了拖放,我可以通过从第一列中选择任何元素进行滚动,然后将其拖放到最后一个元素正下方的第二列,
那么有什么解决办法吗?
可以在此处查看演示 http://dbushell.github.io/Nestable/
这里尝试将元素放置在右侧列的末尾,但是只有将其精确地放在右侧列的最后一个元素下方才会起作用
最佳答案
我查看了插件源代码并找到了解决这个问题的方法, 首先在列表底部添加一些填充
div.dd {
padding-bottom: 200px;
}
在插件源代码中更改此:
if (this.pointEl.hasClass(opt.handleClass)) {
this.pointEl = this.pointEl.parent(opt.itemNodeName);
}
至
if (this.pointEl.hasClass(opt.handleClass)) {
this.pointEl = this.pointEl.parent(opt.itemNodeName);
}else {
var list = this.pointEl.find('> .'+ opt.listClass);
if(list.length) this.pointEl = list.find('.'+ opt.itemClass +':last');
}
关于jquery - 嵌套两列高度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22758713/