I have a div and I am trying to drag it by a image inside the div. Below is my html
<div id="MainDiv">
<img src="Images/Drag.png"/>
<div>Test</div><div>Tes2</div>
</div>
I have made the main div draggable but I want to drag with the help of image drag.png which is inside the maindiv. How to achieve this .Please help me on this..
You can use the handle
-option of the draggable-function:
$( "#MainDiv" ).draggable({
handle: "img"
});
Reference