jQueryUI droppable, stop propagation to overlapped sibling

前端 未结 9 910
忘了有多久
忘了有多久 2020-12-02 01:59

As you can see here: http://jsfiddle.net/rA4CB/6/

When I make the drop in the overlapped area it is received in both droppables, greedy doesn\'t work when the items

9条回答
  •  抹茶落季
    2020-12-02 02:16

    In certain circonstances :

    myjQuery.droppable({
      over:function(evt,ui){
        ui.draggable.attr('drg_time', this.drg_time = evt.timeStamp)
      },
      accept:function(draggeds){
        if(draggeds.attr('drg_time'))
        {
          return draggeds.attr('drg_time') == this.drg_time
        }
        return draggeds.hasClass('acceptable_classes_here')
      },
      out:function(evt,ui){
        // useless but cleaner
        ui.draggable.removeAttr('drg_time')
      }
      drop:...,
    })
    

提交回复
热议问题