Javascript 使用Twitter引导模式

Javascript 使用Twitter引导模式,javascript,twitter-bootstrap,Javascript,Twitter Bootstrap,我很快就会在我的网站上使用twitter引导模式出现问题。我的网站已经加载了引导程序,但按钮没有触发弹出窗口,我不知道为什么。有人能帮我吗 这是我身体标签后面的模态 你可以试试这个 $(document).ready(function() { $("#btnshow").on('click', function(event) { $('#myModal').modal('show'); $('#myModal').on('shown', function() {

我很快就会在我的网站上使用twitter引导模式出现问题。我的网站已经加载了引导程序,但按钮没有触发弹出窗口,我不知道为什么。有人能帮我吗

这是我身体标签后面的模态

你可以试试这个

$(document).ready(function() {
  $("#btnshow").on('click', function(event) {

    $('#myModal').modal('show');
    $('#myModal').on('shown', function() {
      // do more here
    })

  });

});
调用模式窗口的示例按钮

<button id="btnshow">Show</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

js是一个小型JavaScript库,它允许您使用引导模式创建编程对话框,而无需担心创建、管理或删除任何必需的DOM元素或js事件处理程序。下面是最简单的例子:

<button id="btnshow">Show</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
bootbox.dialog({
title: "That html",
message: '<img src="images/bootstrap_logo.png" width="100px"/><br/> You can also use <b>html</b>'
});