Jquery: optimizing Droppable on MouseOver

前端 未结 1 445
渐次进展
渐次进展 2020-12-21 08:54

I\'m using the Draggable/Droppable functionality of Jquery to allow drag-and-drop from a TreeView to a simple HTML table, but am finding that Droppable performance gets very

相关标签:
1条回答
  • 2020-12-21 09:52

    In the end, I managed to avoid it by simply making the TABLE droppable (instead of the individual cells) and then figuring out the dropposition in the drop handler.

    $("#taskTable").droppable({ drop: onDrop, addClasses: false, tolerance: 'pointer' });
    
    function onDrop(event, ui) {
    var theCell = document.elementFromPoint(event.pageX - $(window).scrollLeft(), event.pageY - $(window).scrollTop());
    }
    
    0 讨论(0)
提交回复
热议问题