twitter bootstrap模态没有加载

时间:2013-05-20 07:07:15

标签: javascript html twitter-bootstrap

这是他基本上从twitter bootstrap页面复制的代码。但是,根本没有加载!我的所有文件都是正确的,但模态仍未显示。请帮帮我。

<head>   
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="javascript/autoresize_textbox.js"></script>
<script type="text/javascript" src="javascript/submit_validate.js"></script>

<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head> 

<body> 


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

<!-- Modal -->
<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>
</body>

1 个答案:

答案 0 :(得分:3)

在包含bootstrap js之前,您应先包含<script src="http://code.jquery.com/jquery.js"></script>

<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script> //Optional
<script type="text/javascript" src="javascript/autoresize_textbox.js"></script>
<script type="text/javascript" src="javascript/submit_validate.js"></script>