gpt4 book ai didi

javascript - Bootstrap 模式弹出背景屏幕不会关闭

转载 作者:行者123 更新时间:2023-11-30 12:22:54 25 4
gpt4 key购买 nike

我正在使用 Bootstrap 和 AngularJS 构建应用程序。我正在为内容使用 Bootstrap 模式弹出窗口。其他页面正在加载到 ng-view 中。 ng-view 的内容有模式弹出窗口,当我获得模式弹出窗口并单击链接到下一页的按钮时,我能够看到后面的页面,但模式弹出窗口背景黑色不透明屏幕仍然那里。我怎样才能摆脱这个?但是当我单独运行这些页面时,我不会遇到这样的问题。

代码:

<div id="regular-service" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<!--<img class="modal-cont" src="images/popup.png">-->

<div class="data-extract-popup">
<div class="data-extract-heading">How do you want to use this data?</div>
<table class="data-extract-table">
<tr>
<td><a href="#/clean-data" class="btn btn-lg btn-warning">CLEAN DATA</a></td>
<td><a href="#/raw-data" class="btn btn-lg btn-warning">RAW DATA</a></td>
</tr>
<tr>
<td>Cleaned up for your use.May have some missing pieces.</td>
<td>All pieces of data are intact here.</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>

模态:

  $(".regular").click(function(){
$("#regular-service").modal('show');
});

这是它的样子。 弹出前

enter image description here

弹出后:

enter image description here

弹窗背景还是一样

最佳答案

这是模态的一般行为,当它打开时,它的背景变得惰性并淡出。您可以选择不淡出,但在这种情况下,背景也将始终保持惰性。不淡出的方法是:

  $(".regular").click(function(){
$("#regular-service").modal({backdrop: "false"});
});

这个 http://jsfiddle.net/bgutxt3y/ 的简单 fiddle .尝试使用“为@getbootstrap 打开模态”按钮打开模态。这个 fiddle 使用 HTML 将背景设置为 false,使用

  data-backdrop="false"

在调用 Modal 的按钮的 HTML 中

关于javascript - Bootstrap 模式弹出背景屏幕不会关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30432739/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com