javascript 模态/对话

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 模态/对话相关的知识,希望对你有一定的参考价值。

<!-- Dialog action -->
<div class="modal fade" id="modalAction" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">@UIResources.DialogStockInDraftStateTitle</h5>
            </div>
            <div class="modal-body">
                @UIResources.DialogStockInDraftStateContent
            </div>
            <div class="modal-footer">
                <button id="modalActionButton0" type="button" class="btn btn-primary pull-right" style="margin:0px 0px 0px 0px">@UIResources.Yes</button>
                <button id="modalActionButton1" class="btn btn-primary pull-right" style="margin:0px 10px 0px 0px">@UIResources.No</button>
                <button id="modalActionButtonCancel" class="btn btn-secondary pull-right" data-dismiss="modal" style="margin:0px 10px 0px 0px">@UIResources.Cancel</button>
            </div>
        </div>
    </div>
</div>


<!-- Another Example Modal add new opname -->
<div class="modal fade" id="modalAddNewOpname" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">@UIResources.ButtonAddStocktake</h5>
            </div>
            <div class="modal-body">
                <div class="form-group" style="margin-bottom:35px">
                    <label class="control-label col-md-2" for="QuantityUnitID">@UIResources.ModalGroupItemStocktake</label>
                    <div class="col-md-10">
                        <select class="form-control" data-val="true" id="selectDailyStocktakeSetting" name="QuantityUnitID">
                            <option value="">@UIResources.DropdownSelect</option>
                            @foreach (var dailyStocktakeSetting in ViewBag.DailyStocktakeSettings) {
                                <option value="@dailyStocktakeSetting.ID">@dailyStocktakeSetting.Name</option>
                            }
                        </select>
                        <span class="field-validation-valid" data-valmsg-for="QuantityUnitID" data-valmsg-replace="true"></span>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button id="buttonModalAddNewOpnameYes" type="button" class="btn btn-primary pull-right disabled" style="margin:0px 0px 0px 0px">@UIResources.Yes</button>
                <button id="buttonModalAddNewOpnameCancel" class="btn btn-secondary pull-right" data-dismiss="modal" style="margin:0px 10px 0px 0px">@UIResources.Cancel</button>
            </div>
        </div>
    </div>
</div>
$("#modalAction").modal('show');
$("#modalAction").modal('hide');

以上是关于javascript 模态/对话的主要内容,如果未能解决你的问题,请参考以下文章

javascript 模态/对话

JavaScript实现模态对话框

JavaScript实现模态对话框示例

从 javascript 用于 Web 应用程序的跨浏览器最稳定的模态对话框实现是啥?

javascript中有几种模态框

JavaScript内容梳理 示例之模态对话框 示例之全选和反选以及取消 示例之后台管理左侧菜单