【发布时间】:2016-05-19 02:22:33
【问题描述】:
我的要求是,单击按钮时,应在对话框模式上显示 pdf 文件。 请帮忙!
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>View PDF</h2>
<!-- Trigger the modal with a button -->
<button type="button" href="A - Cover Page.pdf" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">A - Cover Page</button>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
【问题讨论】:
-
stackoverflow.com/questions/13305707/… 的可能重复项。只需在 modal-body 中使用 iframe
-
先生,谢谢您的链接,但我想使用引导模式窗口来完成。
-
你可以像这样在模态体内使用 iframe
<div class="modal-body"> <iframe src="A - Cover Page.pdf"></iframe> </div> -
谢谢先生,但
标签: javascript jquery twitter-bootstrap