我正在尝试从引导程序中获取模态,但由于某种原因,它显示如下:
这是我在bootstrap文档中使用的默认代码:
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<!-- Modal -->
<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">×</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>
提前致谢!
答案 0 :(得分:0)
你用javascript初始化了模态吗?您只需要JQuery,bootstrap CSS文件和bootstrap JS文件。
然后将此代码添加到页面底部的<script>
标记中!
$(document).ready(function () {
$('#myModal').modal();
});
答案 1 :(得分:0)
**修正了把它放在这里关闭它; D
我使用了错误的CDN