twitter-bootstrap – bootstrap模式根本不起作用

我知道这个问题之前已被问过数百次,而且我已经通过了这些问题,但那些问题无法解决我的问题:s

到目前为止这是我的代码

<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" type="text/css" href="style.css">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"> 
    <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"></script>
    <link href="bootstrap/js/bootstrap.min.js" rel="stylesheet" media="screen">
    <link href="bootstrap/js/bootstrap-modal.js" rel="stylesheet" media="screen">
    <link href="bootstrap/js/bootstrap-transition.js" rel="stylesheet" media="screen">

在体内,我有这个:

<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>

<div id="myModal" 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">Close</button>
        <button class="btn btn-primary">Save changes</button>
    </div>
</div>

请注意,我在头部使用了一些其他库,因为我需要它们用于谷歌地图,我试图删除它们但仍然没有触发模态视图.

解决方法

将此行添加到Javascript文件

$(document).ready(function() {
    $("#MyModal").modal();
  });

相关文章

前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...
(1)modal声明一个模态框(2)modal-dialog定义模态框尺寸(...
图片在Bootstrap版本3中,通过为图片添加 .img-responsive ...
<inputtype="text"class="form-controlda...
目录bootstrap-treeview使用小记零、写在前面的话一、功能说...