2012-04-12 8 views
1

以下のように、ドラッグ可能なヘルパー要素のhtmlを変更する必要がある問題がありますか?助言がありますか?JQuery UI Draggable - ドロップされたヘルパー要素のhtmlを変更します。

 <ul id="submenu"> 
      <li><div class="thumb"></div></li> 
      <li><div class="thumb"></div></li>         
     </ul> 

     <ul id="sortable"> 
      <li></li> 
     </ul> 

     -------------- 
     -------------- 

    // #### DRAGGABLE #### 
$(".thumb").draggable({ 
    helper: "clone", 
    appendTo: 'body', 
    connectToSortable: "ul#sortable", 
    revert: "invalid", 
    stop: function(event,ui) { 

     -- -------------------------------- -- 
     -- Change html of ui.helper here ?? -- 
     -- -------------------------------- -- 

    } 
}); 

答えて

0

ドラッグ可能な要素に対してondropイベントを設定することはできません。あなたは捨てられる側でそれをするべきです。

$("#drop").droppable({ 
    drop : function(event,ui) { 
     //do what you want with ui.helper 
    } 
}); 
関連する問題