jQuery UI draggable/sortable/droppable disable drop when droppable limit is reached

前端 未结 2 1800
小鲜肉
小鲜肉 2021-01-23 08:57

JS Bin demo

Task:

I\'m creating an event scheduler using jQuery UI. Events are of a certain length (in minutes) and they can be dragged into dif

2条回答
  •  野性不改
    2021-01-23 09:37

    $( "#daybox" /*or selector for days elements*/ ).bind( "sortreceive", function(event, ui) {
    
       if(/*percent*/ >= 100)
    
          $(ui.sender).sortable('cancel');
    });
    

    then, the dropped element returns to the group.

提交回复
热议问题