使用.live()使用实时事件进行jQuery拖放

时间:2014-02-19 06:43:58

标签: jquery-draggable jquery-droppable

我是jquery的新手。这是我的代码

  // let the gallery items be draggable
        $("li", $gallery).draggable({
            cancel: "a.ui-icon", // clicking an icon won't initiate dragging
            revert: "invalid", // when not dropped, the item will revert back to its initial position
            containment: "document",
            helper: "clone",
            cursor: "move"
        });

        // let the trash be droppable, accepting the gallery items
        $trash.droppable({
            accept: "#gallery > li",
            activeClass: "ui-state-highlight",
            drop: function (event, ui) {
                deleteImage(ui.draggable);
            }
        });

我想让这两个活动现场直播。请帮助我如何根据.live声明这些事件。提前谢谢。

0 个答案:

没有答案