As the title says i want to drag div parent, let's say i have this structure
<div class="parent">
<divc class="draggable"></div>
</div>
$(".draggable").draggable();
So how can i drag .parent
instead of .draggable
.
And no, i don't want to make .parent
draggable instead of .draggable
, since it's gonna be a window which will only be draggable in one place.
Are you trying to make the child element a drag handle?
$(".parent").draggable({ handle: ".draggable" });
This would make it so the whole parent drags but but only uses the draggable div as an anchor.
jsFiddle Demo
Reference:
http://jqueryui.com/demos/draggable/#handle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With