【问题标题】:Jquery sortable issue on empty bootstrap column空引导列上的 Jquery 可排序问题
【发布时间】:2023-03-14 15:34:01
【问题描述】:

我在一些列中有一些引导面板。现在我正在尝试使用 jquery sortable 来安排这些面板,但我无法使其正常工作。

查看 jsfiddle:https://jsfiddle.net/umnvgory/

我的问题:如果我将左侧的面板拖放到右侧,一切正常。但是之后我希望能够将面板从右侧拖回左侧的空列,但即使占位符也不会转到左侧。

我已将列的padding-top: 10px 属性设置为实际上将它们保留在空白空间中。

我的 javascript 看起来像这样:

 $("#container-wrapper").sortable({
   connectWith: ".connectedSort",
   items: "div.panel",
   tolerance: 'pointer',
   revert: true,
   placeholder: 'placeholder',
   forceHelperSize: true,
   zIndex: 9999
 }).disableSelection();

【问题讨论】:

    标签: javascript jquery twitter-bootstrap panel jquery-ui-sortable


    【解决方案1】:

    通过这篇文章找到了我的解决方案。 jQuery UI drop on empty container/list not working

    确保在正确的类上定义$().sortable(),并将它们与sortable()connectWith: 参数结合起来

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-19
      • 1970-01-01
      • 2014-07-10
      • 1970-01-01
      • 2011-10-13
      • 1970-01-01
      • 2011-02-11
      相关资源
      最近更新 更多