2012-04-12 65 views
0

當您敲擊概述的單詞時,會出現一個小小的上下文菜單。拖動你想要的選擇然後釋放。在當前的配置中,它的行爲就好像用戶別無選擇。如果我將#del從#del更改爲#target,那麼它可以工作,但顯然你不能選擇這種方式。jQuery Droppable忽略丟棄

$(function() { 
    $('#word').mousedown(function(ev, ui) { 
     $("#target").slideDown(100); 
    });  
    $('#word').mouseup(function(ev, ui) { 
     $("#target").slideUp(100); 
    });  
    $('#word').draggable({ 
     axis: 'y', 
     containment: 'parent', 
     revert: true, revertDuration: 100, 
     stop: function() { 
      $("#target").slideUp(100); 
     } 
    }); 
    $('#del').droppable({ 
     activeClass: 'over', 
     drop: function() { 
      var vote = alert("Delete action goes here"); 
     } 
    }); 
});​ 

看看小提琴:http://jsfiddle.net/monsto/PF3ty/7/

我失去了什麼?

回答

0

想通了......

簡而言之,draggablestop參數阻礙droppabledrop。它在刪除stop定義並將這些操作放入drop定義中之後起作用。

相關問題