【问题标题】:jQuery UI sortable revert option - enable dragging during animationjQuery UI 可排序还原选项 - 在动画期间启用拖动
【发布时间】:2011-06-23 10:07:44
【问题描述】:

我目前有一个 jQuery UI 可排序元素,我将 revert 选项设置为 1000 以获得流畅但不太快的动画。虽然动画效果很好,但在动画过程中我似乎无法拖动。

我在 jsFiddle 上做了一个简化版:http://jsfiddle.net/bA7Dk/。将1拖动到某处并释放鼠标时,直到动画完成才能拖动2

有没有办法在动画期间启用拖动?

【问题讨论】:

    标签: jquery-ui animation jquery-ui-sortable revert


    【解决方案1】:

    我通过修改jquery.ui.sortable.js来解决它:

    • 将此作为属性添加到$.widget(所有函数也都添加到该处):

      revertingElem: $(),
      
    • _mouseStop里面修改:

      self.reverting = true
      

      self.reverting = true           
      this.revertingElem = $(this.helper);
      
    • _mouseCapture里面修改:

      return false;     (the first occurence)
      

      $(this.revertingElem).stop(true, true);
      

    【讨论】:

      猜你喜欢
      • 2015-10-30
      • 1970-01-01
      • 1970-01-01
      • 2012-07-25
      • 1970-01-01
      • 2011-12-11
      • 1970-01-01
      • 2014-07-02
      • 1970-01-01
      相关资源
      最近更新 更多