【问题标题】:Bootstrap modal open and close only one time then it does not work引导模式仅打开和关闭一次然后它不起作用
【发布时间】:2016-09-29 10:32:28
【问题描述】:

当我在 chrome 控制台中运行以下命令时

$("#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>

【问题讨论】:

    标签: javascript jquery twitter-bootstrap bootstrap-modal


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      问题在于下面的函数,我删除的是模态 html 而不是模态体

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

      为了更正我将上面的功能行更改为:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多