$(document).ready(function() {
$("#dvv").mousedown(function() {
$("#dvv").mousemove(function(e) {
$("#dvv").css({ 'margin-top': e.pageY - 15, 'margin-left': e.pageX - 15 });
});
});
<div id="dvv" style="background-color: Blue; width: 150px; height: 150px; margin: 250px 550px;
cursor: move;">
test Div
</div>
Div Click nonstop drag help me
Please note: I’ve never tried to implement this before, but this seems like a start.
Please note that I removed the margins from your div, and added absolute positioning, so it is not the original element you started with.
Hopefully this will give you something to work with.
UPDATE: Just changed it a bit. Now, using offset(coordinates) instead of css, it works regardless of margin settings, and absolute positioning doesn’t need to be set.