I have two divs, and I just want the second one to be under [in z-index] the first one, I read about it here and I figured out that I have to use the following JQuery script:
<script type="text/javascript">
$('#secondDiv').insertBefore('#firstDiv');
</script>
I tried it, but it didn't work with me, Any help!!
<DetailedTemplate>
<div id="firstDiv" style="background-color:Black">
<asp:ImageButton ID="SelectButton" Visible='<%# org.SelectedValue == null || Container.DataElement("ID").ToString() != org.SelectedValue.ToString() %>' runat="server" CommandName="Select" CommandArgument='<%# Container.DataElement("ID") %>'
OnPreRender="SelectButton_PreRender" style="border-style:none; Height:58px; width:113px; cursor:hand" ImageUrl="~/Contents/Images/item-background.png"/>
</div>
<div id="secondDiv" style="background-color:Red" >
<center style=" margin: 5px; padding-top: 5px; padding-right: 5px; padding-left: 5px;">
<asp:LinkButton ID="lnkTitle" ForeColor="#6c1b24" Font-Bold="true" runat="server"
Text='<%# Container.DataElement("Name") %>' NavigateUrl="http://google.com">
</asp:LinkButton>
<div runat="server" visible='<%# Convert.ToInt32(Container.DataElement("NumOfChildren")) > 0 %>'
style="border: 1px solid #6c1b24; width: 15px; text-align: center; height: 15px;
margin-top: 25px; background-color: #fddb73; font-size: larger; font-family: Courier New;">
<asp:LinkButton ID="btnExpand" runat="server" ForeColor="#6c1b24" CommandArgument='<%# Container.DataElement("ID")%>'
CommandName="Expand" Font-Underline="false" Text='<%# Container.NumberOfChildren > 0 ? "-" : "+" %>' />
</div>
</center>
</div>
<script type="text/javascript">
$('#secondDiv').insertBefore('#firstDiv');
</script>
</DetailedTemplate>
Note: I can't put my divs as absolute in my situation.