Problem with jquery draggable div on TOP PAGE
I have a problem. I have a jquery script that collects data on a screen controls through an ajax post. When you get the data for each screen control it is creating dynamically.
however I have with these controls the draggable effect the div I want to move to another however I puts them behind the div.
I publish my html code (which is shown after creating the controls).
Can you help me please?
Thank you!
JQuery CODE
var z=600000;
$(function(){
-
$(".Controles,.ChKControles").draggable({
-
cursor:"move",
-
revert:"invalid",
-
scroll:false,
-
//containment:"#drop-zone",
-
//stack:"#drop-panel",
-
start:function(event,ui){
-
$(this).css("z-index",z++);
-
},
-
drag:function(event,ui){
-
$( this ).css({ top: ui.offsetY, left: ui.offsetX });
-
$(this).removeClass("AcceptPost");
-
$(this).removeClass("DeclinePost");
-
$(this).addClass("OnDrag");
-
},
-
stop:function(event,ui){
-
$(this).removeClass("OnDrag");
// $(this).css("position","absolute");
-
}
-
});
HTML
Drag Code
-
<div id="left-panel">
-
<div id="Controls" class="DivTool">
-
<div id="CtrlContent" runat="server" class="ContentStyle">
-
<div id="53157" class="Controles ui-resizable ui-draggable">
-
<div class="DivLabel"><label class="LblControles">
-
Folio[Numerico]
-
</label>
-
</div>
-
<div class="TxtControles">
-
[AUTO]
-
</div>
-
<div style="z-index: 1000;" class="ui-resizable-handle ui-resizable-e">
-
</div>
-
<div style="z-index: 1000;" class="ui-resizable-handle ui-resizable-s">
-
</div>
-
<div style="z-index: 1000;" class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se">
-
</div>
-
</div>
-
</div>
-
</div>
-
</div>
-
</div>
Drop Code
- <div id="drop-panel">
- <div id="drop-zone">
- <table id="drop-controls">
- <tr style="width: 100%; height: 100%;" id="Row1">
- <td id="Column1">
- </td>
- </tr>
- </table>
- </div>
- </div>
STYLE
- #drop-panel
{
position:fixed;
left:280px;
height:100%;
top:276px;
right:0px;
bottom:0px;
overflow:auto;
background-color:#EBEBEB;
z-index:0;
}
- .DivTool
{
position:relative;
width:280px;
height:58px;
background-color:#58595B;
border-top:solid 1px #414042;
border-bottom:solid 1px #414042;
z-index:50000000;
}
- .ContentStyle
{
position:absolute;
top:58px;
bottom:0px;
left:0px;
right:0px;
width:280px;
height:auto;
overflow:auto;
overflow-x:hidden;
background-color:#939598;
border-top:solid 2px #414042;
z-index:50000;
}
- .Controles
{
position: relative;
margin:4px 4px 4px 4px;
width:240px;
height:60px;
background-color:#666666;
font-size:inherit;
}
![]()