bootstrap Modal 點擊超連結顯示圖片
<!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="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>顯示照片</h2>
<!-- Trigger the modal with a button -->
<a data-toggle="modal" data-target="#myModal">mayday.png</a>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<img id="imageresource" src="https://i.ytimg.com/vi/3wrto8oJu5A/maxresdefault.jpg" style="width: 400px; height: 264px;">
</div>
</div>
</div>
</div>
</div>
</body>
</html>
範例 :
https://jsfiddle.net/toreoo123465/t2onxmcm/
參考 :
https://stackoverflow.com/questions/25023199/bootstrap-open-image-in-modal