2012-10-23 3 views
1

현재 프로젝트를 진행 중입니다. 두 개의 div에 바인딩 된 두 개의 버튼이 있습니다. 버튼 1을 누르면 #draggableDiv 1이 표시되고 버튼 2를 누르면 # draggableDiv2가 표시됩니다. 그런 다음 #droppableDiv로 드래그 할 수 있습니다. 나는 어떤 div가 삭제되었는지 알아볼 수 있기를 원합니다.드롭 이벤트 감지

drop: function(event, ui) { 

그런 다음 드롭 기능에서이 같이 그것을 감지 할 수 있습니다 :

var dropped = ui.draggable.attr('id'); 
if ("draggableDiv1" == dropped) 
etc. 
+0

pd http://stackoverflow.com/questions/7265119/how-to-use-jquery-to-detect-value-changed-event-when-user-drag-drop-text-into –

+0

언급하거나 JQuery UI를 사용하는 걸 깜빡 했나요? –

+0

예, JQuery UI를 사용하고 있습니다. – ocat

답변

0

if("#draggableDiv1" == dropped) 
    { 
     Run this code; 
}else{ 
     Run this code;