1

以下のように、ドロップ時にドラッグ可能なヘルパー要素の 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 ?? --
        -- -------------------------------- --

    }
});
4

1 に答える 1

0

ドラッグ可能な要素に ondrop イベントを設定することはできません。ドロップ可能な側で行う必要があります。

$("#drop").droppable({
    drop : function(event,ui) {
         //do what you want with ui.helper
    }
});
于 2012-04-12T22:52:24.677 に答える