【问题标题】:Does bootstrap-modal.js require additional javascript?bootstrap-modal.js 是否需要额外的 javascript?
【发布时间】:2012-01-11 11:56:20
【问题描述】:

我在使用 twitter 的 bootstrap-modal javascript 时遇到问题。

我只是使用他们页面上的相同代码

<!-- sample modal content -->
<div id="modal-from-dom" class="modal hide fade">
    <div class="modal-header">
        <a href="#" class="close">&times;</a>
        <h3>Modal Heading</h3>
    </div>
    <div class="modal-body">
        <p>One fine body…</p>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn primary">Primary</a>
        <a href="#" class="btn secondary">Secondary</a>
    </div>
</div>

然后

<button data-controls-modal="modal-from-dom" data-backdrop="true" 
    data-keyboard="true" class="btn primary">Launch</button>

当然,当我单击启动按钮时,什么也没有发生。我应该在 script.js 文件中添加一些内容吗?

在我的标题中,我正在加载 jquery、bootstrap 和一堆其他东西。我的代码应该可以工作,还是有什么我做错了?

感谢任何答案

【问题讨论】:

    标签: javascript jquery twitter-bootstrap


    【解决方案1】:

    你是这样初始化的吗?

    $('#modal-from-dom').modal(options)
    

    【讨论】:

      猜你喜欢
      • 2018-07-08
      • 1970-01-01
      • 2021-12-19
      • 2018-11-21
      • 1970-01-01
      • 2020-04-16
      • 2011-03-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多