HTML 框架 - 防止引导弹出窗口在用户单击正文时消失

HTML frame - Prevent bootstrap popup to disappear when user click body

本文关键字:用户 窗口 单击 正文 消失 框架 HTML      更新时间:2023-09-26

我正在使用引导模式弹出窗口来显示一条消息。当我在 html 框架内使用以下语句时,当用户单击正文中的任何位置时,模态对话框会消失。我的要求是防止此弹出窗口消失。

$('#testModel').modal({backdrop: 'static', keyboard: false});

<div class="modal fade" id="testModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body err-cnct">
                <h2><i class="demo-icon fa-lg icon-cancel"></i></h2>
                <p> <h4 class="modal-title">Connection Error!</h4>
                Connection to the Hub has been lost. <br/>Please check power and Ethernet connections. </p>
            </div>
        </div>
    </div>
</div>

谢谢。

请参阅此处的文档。按如下方式设置数据属性:

data-backdrop="static"