模态背景与bootstrap模态

时间:2016-07-14 13:00:02

标签: javascript jquery html css twitter-bootstrap

我尝试了这个解决方案:https://stackoverflow.com/questions/22056147/bootstrap-modal-backdrop-remaining 但没有解决方案 我在我的屏幕第一次尝试diplay bootstraps模式它第二次完美,但背景更暗(错误) 有这两行

这是我的js

$(".Ok").modal("show");
        $("#alert").on("hidden.bs.modal", function () {
                $(this).removeClass("Ok");

        });

注意:"确定"我从json数据动态引入的类

并在第二个模态中单击关闭按钮后显示较暗的叠加背景

它在html

中显示

这是我的HTML

<div id="alert" class="modal fade {{popupBtn1Txt}}">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-body">
                        <p>{{popupErrMsg}}</p>
                    </div>
                    <div class="modal-footer text-center">
                        <button type="button" id="btnc" class="btn btn-default" data-dismiss="modal" aria-hidden="true">{{popupBtn1Txt}}</button>
                    </div>
                </div>
            </div>
        </div>

{{popupBtn1Txt}} - &gt; &#34;确定&#34;动态使用带有jSON的handlebarjs支持

我不想要黑色叠加背景

1 个答案:

答案 0 :(得分:0)

我将id称为动态数据,并在弹出用法结束后删除了id。 再次,如果有需要,那么它将从json响应中动态添加id,并使用触发器删除叠加层以及循环

    $("#Ok").modal("show");
        $('#Ok').on('hidden.bs.modal', function () {
             $('.bg_limegreen').trigger('click');
             $(".modal").attr("id","");
            });
相关问题