Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!

I have used draggable on a div that contains 2 other div objects.

XML
<div id="MustBeSolvedByRoot" class="DialogRoot ui-draggable"
style="width: 610px; height: 20px; position: absolute; top: 0px; left: 5px; visibility: visible;">
<div id="MustBeSolvedHeader"><header height 20></div>
<div id="MustBeSolvedContent"><content height 600></div>
</div>

$('#MustBeSolvedByGroupRoot').draggable({ containment: "#root", scroll: false });



I only want to be able to drag the div when pressing the root/Header div and not the content div (i have scrollbar there and the div is dragged then i try to drag the scrollbar) so it acts like a dialog (i don't want to use the jquery dialog). Is it possible to do this?


Thanks!
Posted
Updated 24-May-11 0:36am
v2

1 solution

I found a solution for this, i added a handle to the div header.

$('#DivRoot').draggable({ containment: "#root", scroll: false, handle: "#DivHeader" });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900