Recently, I've been experimenting with a small project involving draggable divs. However, the code I've written doesn't seem to be functioning properly, causing JQuery to become unresponsive.
Is there an alternative method that is simple and efficient for achieving drag functionality without using .draggable?
var hold = false;
//Drag Elements
$('#example').mousedown(function(){
hold = true;
});
$('#example').mouseup(function(){
hold = false;
});
$(document).on('mousemove', function(e){
$('#example').css({
while(hold){
left: e.pageX-50,
top: e.pageY-50
}
});
});
Thank you!