我嘗試使用引導程序在單擊圖像時添加模式,它應該彈出。點擊圖片時沒有任何事情發生。使用引導程序添加模態,不起作用
頭
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link href='https://fonts.googleapis.com/css?family=Crete+Round' rel='stylesheet' type='text/css'>
<title>Jordan Schultz's Portfolio</title>
</head>
圖片
<div class = "col-md-4"><img src = "http://loremflickr.com/300/200/soccer/all" class = "img-responsive center-block img-rounded data-toggle="modal" data-target="#project1""><h3 class = "text-center">Test</h3></div>
模態碼
<div class="modal fade" id="project1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Favorite App Page</h4>
</div>
<div class="modal-body">
<img class="img-responsive" src="http://loremflickr.com/300/200/soccer/all">
This was my first project in this class. I learned a lot about HTML and CSS.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
如果這是您的實際代碼,那麼至少您已經對標記中的引號進行了修改。 – beercodebeer
數據目標=「#PROJECT1」」似乎有額外的雙引號? –