Search code examples
jquery-uijquery-ui-draggablejquery-ui-droppable

Delay initializaton for JQuery drag and drop plugins


Is it possible to delay the jQuery UI drag and drop plugins from being initialized until a movement or click is made? Not sure if this is possible. I have a ton of cells using the drag and drop, like an Excel grid, and performance isnt great.


Solution

  • I went this route and it seems to work.

    $.fn.liveDraggable = function (opts) {
        this.one("mouseover", function () {
            if (!$(this).data("init")) {
                $(this).data("init", true).draggable(opts);
            }
        });
        return this;
    };