B
B
balex7772020-05-13 15:59:30
JavaScript
balex777, 2020-05-13 15:59:30

How to make jquery draggable and droppable to drag div blocks to other table td cells?

Hi, I'm trying to set up dragging a div block into any td cell of a table

. There is a table with many td cells, some of them have div blocks, as a result, these divs can be transferred to empty td cells

. here is my code, but for some reason the droppable does not work does not accept a div and after removing the cursor from the dragged element, it returns to its place

$(function() {
  
        $(".div_in_td").draggable();

        $(".td_block").droppable({
                hoverClass: "hover_droppable", 
        });
  
    });


I tried to put empty divs in td_block so that they could accept draggable, I thought it was because of td, but it's still the same.
Who knows what's the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-05-13
@balex777

https://jsfiddle.net/eq956pyb/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question