I am not able to drag and drop a <DIV>
in a particular position.
The <DIV>
's right now get added to the bottom of the previous <DIV>
even if I move the first <DIV>
away from the initial position.
For example:
Lets say each <DIV>
height = 50, width = 100
;
When I drop the first <DIV>
it is dropped at position, say (10,10)
The next <DIV>
gets dropped at (10,10+50).
The next one at (10,10+50+50).
I want all the <DIV>
's to drop at (10,60).
My drop function:
drop: function(ev, ui) {
if($(ui.draggable).is("img")){
//$(this).css("position", "absolute");
$(this).position().left = 85;
$(this).position().top = 338;
//$(this).css("position", "relative");
}
});
If I set the position to absolute. It drops it at the position specified but further drag and drop does not happen.
Can you guys offer some help. Thanks in advance.
Update: This is my html code with the three divs and the style for left div and right div. No particular style given to main div except height.
<div id="maindiv" style="height:500px">
<div id="left">
<img id="1" src="/1.png"/>
</div> <!-- Left Div End -->
<div id="content">
</div> <!-- Content End -->
</div> <!-- main div End-->
Content style:
content {
border:2px solid #DFA214;
float:right;
height:400px;
margin:1px;
overflow:auto;
position:relative;
width:74%;
}
If I change the position to absolute then drag and drop does not work further:
left {
border:2px solid #DFA214;
float:left;
height:400px;
margin:1px;
position:relative;
width:24%;
}