我在实现Bootstrap 3 Modal时遇到了问题。我只是使用在Bootstrap网站上给出的代码。
这是我的Bootstrap代码,我正在测试:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Modal Test</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/stylish-portfolio.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<script src="js/bootstrap.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<!-- 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-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<object type="application/pdf" data="SabareeshKappagantu.pdf" width="500" height="500">this is not working as expected</object>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<!--modal-->
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
尝试在bootstrap引用之前添加jquery引用。