Is there a way to nest drag/dropables using jquery ui, without knowing how deep to nest the divs?
This is what I have been doing.
someElement
.droppable({
greedy: true,
accept: '.Content1',
drop: function(event, ui) {
$(ui.draggable).hide('explode', 1000);
$(this).append(ui.draggable);
ui.draggable
.removeClass('Content1')
.addClass('Content2')
.css({ 'left': 0, 'top': 0 })
.show('slide', 1000)
.draggable('option', 'containment', '#' + $(this).attr('id'))
.droppable({
greedy: true,
accept: '.Content2',
drop: function(event, ui) {
$(ui.draggable).hide('explode', 1000);
$(this).append(ui.draggable);
ui.draggable
.removeClass('Content2')
.addClass('Content3')
.css({ 'left': 0, 'top': 0 })
.show('slide', 1000)
.draggable('option', 'containment', '#' + $(this).attr('id'));
return false;
}
});
return false;
}
});
(The code might not run, I just pulled out the relevant parts from my code)
If I want to nest the divs deeper I need to add another .droppable call, this is a problem because I need this to be dynamic since I do not know how deep I will need to nest.
Is it possible to do this without knowing how deep I want to nest divs?
Is there a way to do this without having to call .droppable({ }) all the time?