Bootstrap模式弹出窗口没有显示

the*_*ays 3 javascript jquery modal-dialog twitter-bootstrap

我正在尝试使用Bootstrap创建一个简单的模态弹出窗口.我从http://getbootstrap.com/javascript/#modals获取了示例,我的代码看起来像这样..

<html>
    <head>
        <script src="js/jquery.js"></script>
        <script src="js/bootstrap.js"></script>
        <script src="js/bootstrap-modal.js"></script>
        <link rel="stylesheet" href="css/bootstrap.css" />
    </head>
    <body>
        <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
            Launch demo modal
        </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-hidden="true">&times;</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>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

当我在我的浏览器上运行并单击按钮时,弹出窗口仅在几毫秒内显示然后再次关闭..如何防止弹出窗口关闭?

Sri*_*r R 11

试试这个

<script src="js/bootstrap.js"></script> // This JS have all necessary files
Run Code Online (Sandbox Code Playgroud)

从您的文件中删除以下JS

<script src="js/bootstrap-modal.js"></script>
Run Code Online (Sandbox Code Playgroud)

DEMO