【问题标题】:Bootstrap modal issue (not able to show the second modal)引导模式问题(无法显示第二个模式)
【发布时间】:2015-12-16 09:01:08
【问题描述】:

所以我有两个模式,这取决于我点击的按钮触发

第一个是这样触发的:

<a id="de_details" data-toggle="modal" data-target=".show-de-banks"> </a>

它是这样构建的

<div class="modal fade show-de-banks" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    bla bla
                <div class="modal-body">
                    bla bla
                </div>
                <div class="modal-footer">
                    bla bla
                </div>
            </div>
    </div>
</div>

使用按钮调用第二个:

<button class="btn btn-warning" data-toggle="modal" data-target=".open-dialog">Open dialog with IT-Team</button>

它的构建方式相同:

<div class="modal fade open-dialog" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                dsfgdfg
            </div>
            <div class="modal-body">
                sdgfsdgsd
            </div>
            <div class="modal-footer">
               sdfds
            </div>
        </div>
    </div>
</div>

当我打开第一个时,我没有问题。

但是当我想打开第二个时,它一出现就消失了。

我知道:

  • 我只需要包含一个 js 引导文件
  • 我的脚本必须放在最后(为了页面快速加载)

我错过了什么吗?

【问题讨论】:

  • 你能解决你的问题吗?
  • 将按钮类型设为按钮
  • @UbiquitousDevelopers:谢谢!正是解决方案。该死!
  • 哈哈哈。我应该发布作为答案而不是评论。下次祝我好运
  • @UbiquitousDevelopers 你还是可以的!

标签: javascript jquery twitter-bootstrap modal-dialog bootstrap-modal


【解决方案1】:

正如 Ubiquitous Developers Bootstrap modal issue (not able to show the second modal) 的评论所说,您应该将按钮 type 设为 button

<button type="button" class="btn btn-warning" data-toggle="modal" data-target=".open-dialog">Open dialog with IT-Team</button>

【讨论】:

    猜你喜欢
    • 2018-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-24
    • 1970-01-01
    • 2022-11-15
    • 2021-07-15
    相关资源
    最近更新 更多