模态弹出窗口未显示在另一个模态弹出窗口之上

modal popup not showing on top of another modal popup

已更新

我正在尝试将模态用作另一个模态的确认提示,但确认模态在 onclick 上不可见。这是我设置的模态属性。

父模态。

我在 asmx 文件中调用我的父模态函数,然后也在 asmx 文件中调用我的子模态函数。

<div id="ShowDetails" class="popup" tabindex="-1" style="position:absolute;" role="dialog">
    <div class="panel panel-green">
        <div class="panel-heading">Parchase Request Details</div>
        <div class="panel-body">
            <div class=" col-md-12">
                <div class="form-inline">
                    <input id="pdid" style="display: none; width: 90PX; margin: 2px;" type="hidden" />
                    <%--<asp:HiddenField ID="PDId" runat="server" />--%>
                    <table class="table table-condensed">
                        <tr>
                            <td>
                                <input id="item" style="display: none; width: 90PX; margin: 2px;" /></td>
                            <td>
                                <input id="quantity" style="display: none; width: 90PX; margin: 2px;" />

                            </td>
                            <td>
                                <input id="eprice" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="make" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="discription" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>

                                <a id="DoneEditingbtn" role="button" onclick="DoneEditing()" style="color: #72c02c; display: none; width: 100PX; margin: 2px;">Update</a>
                            </td>
                            <td><a id="cancleediting" role="button" onclick="cancleeditingdetail()" style="color: #72c02c; display: none; width: 100PX; margin: 2px;">cancel</a>
                            </td>
                        </tr>
                    </table>
                    <table class="table table-condensed">
                        <thead>
                            <tr style="background-color: #01cc66;">
                                <th>Item Name</th>
                                <th>Quantity</th>
                                <th>Estimated Price</th>
                                <th>Make</th>
                                <th>Discription</th>
                                <th>Options</th>
                            </tr>
                        </thead>
                        <tbody id="tblgetdetails">
                        </tbody>
                    </table>
                    <div id="Alert"></div>
                </div>
            </div>
        </div>
        <span class="popup-btn-close" data-dismiss="modal">close</span>
    </div>
</div>

确认模式。

    <div id="ApproveMod" class="popup" style=" z-index:2; position:absolute; left: 50%; width: 40%; border: 10px solid #666;">
    <div class="col-lg-6">
        <i>Are you sure to Approve this data?</i>
    </div>
    <i id="pheadIdApp"></i>
    <i id="pbdIdApp"></i>
    <div class="col-lg-6">
        <a class="btn-u btn-u-red" href="#" role='button' style="text-align: center; width: 45%;" onclick="Approve()">Yes </a>
        <button class="btn-u btn-u-green-custom " style="text-align: center; width: 45%;" data-dismiss="modal">NO</button>
    </div>
</div>

父模态显示正确,但是当我单击应该切换子模态的父模态按钮时,它不起作用,在 ASMX 中,我在 onclick 上定义了我的子模态函数,如下所示。

<a role='button' class='form-control' onclick='AppModal(PHId+","+PBDId)'>Approve</a>

这是我在脚本中使用的子调用方法。

function AppModal(phid,pbdid) {
        $("#pheadIdApp").val(phid);
        $("#pbdIdApp").val(pbdid);
        $("#ApproveMod").modal("show");
    }

它应该可以正常工作我已经使用了很多次,但现在我卡住了,不知道我可能在哪里错过了这个技巧,我们非常希望得到任何帮助。

真的很有趣昨天我得到了你对我的问题的回答,这是关于同样的问题,现在我发现你被困在这里。 将您的子模态位置更改为相对位置,并为默认图层分配大于 1040 的 z-index 值。