bootstrap模态框按照官网原码写的,在浏览器中不能显示,求原因
bootstrap吧
全部回复
仅看楼主
level 4
mihudebaobei 楼主
代码:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link href="css/bootstrap.css" type="text/css" rel="stylesheet">
<script src="//cdn.bootcss.com/jquery/3.0.0-alpha1/jquery.js"></script><!--引用的官网的jquery在页面中能起作用,但在哪下载一直没找到??-->
<script src="js/bootstrap.min.js"></script>
<!-- <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>-->
<title>模态框(弹出框)</title>
</head>
<body>
<!--模态框不能重叠,务必将模态框放在body内,避免其它组件对它的影响-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<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>
<script>
$("#myModal").modal("show");
</script>
</body>
</html>
2015年08月15日 02点08分 1
level 12
首先检查js路径,再次检查html结构
2015年08月16日 02点08分 2
level 8
所有cdn路径路径差http:
2015年08月16日 14点08分 3
level 4
mihudebaobei 楼主
模态框已经实现了,原因找到了,引用的官网jquery更新了,而本地没有更新导致的
2015年08月17日 07点08分 4
1