【问题标题】:Twitter Bootstrap modelTwitter 引导模型
【发布时间】:2014-01-01 19:51:16
【问题描述】:

我正在尝试制作功能正常的引导模型,但它不起作用。无法找到我缺少的东西。 jsfiddle:jsFiddle link here

<div id="modal-3" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
    <p>One fine body…</p>
</div>
<div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">No</button>
    <button class="btn btn-primary" data-dismiss="modal">Yes</button>
</div>

<a href="#modal-3" role="button" class="btn" data-toggle="modal">Confirm</a>

【问题讨论】:

    标签: javascript css twitter-bootstrap bootstrap-modal


    【解决方案1】:

    删除模态容器上的hide 类。它与模态本身是多余的。工作示例:

    <div id="modal-3" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> ...

    【讨论】:

    【解决方案2】:

    你不见了,bootstrap.min.js 或者 bootstrap modal.js,别忘了发起。

    添加$('#myModal').modal();$('#myModal').modal({ options }); 在脚本的底部。

    more about bootstrap modal APIs

    【讨论】:

    • bootstrap.min.js 已添加,您可以在外部资源中看到它。
    • 糟糕,没注意到。那你还没有初始化
    • 我也试过 $('#myModal').modal() ,但没有显示模型
    猜你喜欢
    • 1970-01-01
    • 2015-06-05
    • 1970-01-01
    • 1970-01-01
    • 2012-04-11
    • 1970-01-01
    • 2013-11-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多