Reputation: 825
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..
Upvotes: 1
Views: 6928
Reputation: 2461
with jquery events
$('#movable').on('mousedown',)
possible without jquery UI also
Upvotes: 0
Reputation: 7878
You can use the handle
-option of the draggable-function:
$( "#MainDiv" ).draggable({
handle: "img"
});
Reference
Upvotes: 5