You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$(".drag").draggable({
helper: "clone"
});
$(".drop").droppable({
accept: ".drag",
drop: function(event, ui) {
//If the dragged element is `X` or `O` on the top
if($(ui.draggable).hasClass('main')){
var cloned = $(ui.draggable).clone();
cloned.removeClass('main');
$(this).append(cloned);
//cloned.draggable();
}
$(this).droppable('disable');
},
out: function(event, ui) {
$(this).droppable('enable');
}
});
//Disable Droppable for elements with .disabled
$('.disabled').droppable('disable');
The issue is that I can't drag the cloned element after dropping it. I tried to add this cloned.draggable(); it's commented out to make that cloned element draggable but the issue is that I can drag it to disabled and to other cells which already contain cloned elements and the cell that element dragged out is disabled.
I want each cell to contain only one dragged element and if I move the element to another cell it shouldn't be disabled.
The text was updated successfully, but these errors were encountered:
I tried different versions of jQuery UI and jQuery the same issue occurs. I'm not sure if this issue is related to jQuery UI functionality or jQuery version.
I want to be able to clone the main draggable elements and be able to drag the cloned element as well.
You can run the code here: https://jsfiddle.net/2qatpe47/
CSS:
HTML:
jQuery:
The issue is that I can't drag the cloned element after dropping it. I tried to add this
cloned.draggable();
it's commented out to make that cloned element draggable but the issue is that I can drag it to disabled and to other cells which already contain cloned elements and the cell that element dragged out is disabled.I want each cell to contain only one dragged element and if I move the element to another cell it shouldn't be disabled.
The text was updated successfully, but these errors were encountered: