I'm currently working on a drag and drop web application using JQueryUI, but I'm facing an issue with responsiveness. I was wondering if anyone could provide some guidance or assistance?
Here is a snippet of my JavaScript code:
$(document).ready(function() {
$(".draggable").draggable({
helper: "clone",
cursor: 'move'
});
$("#dropzone").droppable({
drop: function (event, ui) {
var canvas = $(this);
if (!ui.draggable.hasClass('object')) {
var canvasElement = ui.helper.clone();
canvasElement.addClass('object');
canvas.find("div").removeClass('activeElement');
canvasElement.addClass('activeElement');
canvasElement.removeClass('draggable ui-draggable ui-draggable-handle ui-draggable-dragging');
canvas.append(canvasElement);
canvasElement.css({
left: (ui.position.left),
top: (ui.position.top),
position: 'absolute',
zIndex: 10
});
canvasElement.draggable({
cursor: 'move',
containment: '#dropzone'
});
}
}
});
I am currently employing absolute positioning in my design. How can I go about making this layout more responsive?