$ ( «#Dialog»). Parent (). AppendTo ($ («form: first»));

Я открываю несколько диалогов jQuery на своей странице и использую:

$("#dialog2").parent().appendTo($("form:first")); //This was working, no problem.

Я заметил, что когда снова применил его к диалогу 3, он остановил работу этой строки в диалоге 2. Как это можно использовать для разных диалогов?

$("#dialog2").dialog({
    bgiframe: false,
    autoOpen: false,
    height: 410,
    width: 800,
    modal: true,
    draggable: true,
    resizable: true
});

$("#dialog2").parent().appendTo($("form:first")); //doesn't work now

$("#dialog3").dialog({
    bgiframe: false,
    autoOpen: false,
    height: 410,
    width: 600,
    modal: true,
    draggable: true,
    resizable: true
});

$("#dialog3").parent().appendTo($("form:first"));

HTML:

<div id="dialog3" title="Attachments">
    <p id="P1">
        <asp:Button ID="btnAttach" runat="server" Text="Attach files" class="float-left ui-button"/></p>
    <fieldset>

    </fieldset>
</div>


<div id="dialog2" title="Notes">
    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/icons/user_comment.png" />
    <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Larger" Text="Notes"></asp:Label>
    <br />
    &nbsp;
    <div style="overflow: auto; height: 310px; width: 780px;">
        <fieldset>
            <br />
            <asp:TextBox ID="txtNote" runat="server" CssClass="notetext" Width="740px" Rows="6"
                TextMode="MultiLine" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" />
            <br />
            &nbsp;
            <div style="width: 743px">
                <asp:Button ID="btnNoteSave" runat="server" Text="Save" class="float-right ui-button" />
            </div>
        </fieldset>
    </div>
6
задан marc_s 19 February 2016 в 06:39
поделиться