我是 Twitter Bootstrap 的新手。我正在处理模态面板,但未显示。它使屏幕淡出,但模态本身不会出现。我检查了错误控制台,没有错误。
我的代码在 <head>
中标签;我包括如下脚本:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $ruadmin ?>js/bootstrap.js"></script>
<script src="<?php echo $ruadmin ?>js/tablesorter/jquery.tablesorter.js"></script>
<script src="<?php echo $ruadmin ?>js/tablesorter/tables.js"></script>
模态页面:
<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-large">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">Welcome</h3>
</div>
<div class="modal-body">
<p> Hello </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>
最佳答案
您需要使用data-target
标签。
尝试用 data-target="#myModal"
替换 href="#myModal"
属性。
此外,你已经放了一个hide
类,我想它不应该放在那里。
看例子here
关于javascript - Twitter Bootstrap 模式不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20472588/