Bootstrap模式只打开和关闭一次然后它不起作用

时间:2016-09-29 10:32:29

标签: javascript jquery twitter-bootstrap bootstrap-modal

enter image description here

当我在chrome console中运行以下命令时



$("#inactive-selected-requests-modal").modal("show")




它不显示模态和叠加来到那里。 chrome控制台输出是:

<div class="modal fade" id="inactive-selected-requests-modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;"></div>

2 个答案:

答案 0 :(得分:1)

删除style="display: none;"。它解决了我的问题。

答案 1 :(得分:0)

问题在于以下功能,我正在删除模态html而不是模态主体

$(document).on("hidden.bs.modal", "#inactive-selected-requests-modal", function () {
            $("#inactive-selected-requests-modal").html("");
        });

要更正我将以上功能线更改为:

$("#inactive-selected-requests-modal-body").html("");