Note that there are some explanatory texts on larger screens.

plurals
  1. PODiv above another one JQuery script didn't work !
    primarykey
    data
    text
    <p>I have two divs, and I just want the second one to be under [in z-index] the first one, I read about it <a href="https://stackoverflow.com/questions/220273/css-positioning-div-above-another-div-when-not-in-that-order-in-the-html">here</a> and I figured out that I have to use the following JQuery script:</p> <pre><code>&lt;script type="text/javascript"&gt; $('#secondDiv').insertBefore('#firstDiv'); &lt;/script&gt; </code></pre> <p>I tried it, but it didn't work with me, Any help!!</p> <pre><code>&lt;DetailedTemplate&gt; &lt;div id="firstDiv" style="background-color:Black"&gt; &lt;asp:ImageButton ID="SelectButton" Visible='&lt;%# org.SelectedValue == null || Container.DataElement("ID").ToString() != org.SelectedValue.ToString() %&gt;' runat="server" CommandName="Select" CommandArgument='&lt;%# Container.DataElement("ID") %&gt;' OnPreRender="SelectButton_PreRender" style="border-style:none; Height:58px; width:113px; cursor:hand" ImageUrl="~/Contents/Images/item-background.png"/&gt; &lt;/div&gt; &lt;div id="secondDiv" style="background-color:Red" &gt; &lt;center style=" margin: 5px; padding-top: 5px; padding-right: 5px; padding-left: 5px;"&gt; &lt;asp:LinkButton ID="lnkTitle" ForeColor="#6c1b24" Font-Bold="true" runat="server" Text='&lt;%# Container.DataElement("Name") %&gt;' NavigateUrl="http://google.com"&gt; &lt;/asp:LinkButton&gt; &lt;div runat="server" visible='&lt;%# Convert.ToInt32(Container.DataElement("NumOfChildren")) &gt; 0 %&gt;' 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;"&gt; &lt;asp:LinkButton ID="btnExpand" runat="server" ForeColor="#6c1b24" CommandArgument='&lt;%# Container.DataElement("ID")%&gt;' CommandName="Expand" Font-Underline="false" Text='&lt;%# Container.NumberOfChildren &gt; 0 ? "-" : "+" %&gt;' /&gt; &lt;/div&gt; &lt;/center&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $('#secondDiv').insertBefore('#firstDiv'); &lt;/script&gt; &lt;/DetailedTemplate&gt; </code></pre> <p>Note: I can't put my divs as absolute in my situation.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload