ブートストラップに問題があります - モーダルの 1 つだけがポップアップします! コードを確認しましたが、問題が何であるかを見つけることができませんでした。最初のモーダルは他のモーダルとまったく同じようにコーディングされているため、何が問題なのかわかりません。ここに CodePen があります (jsFiddle のような): CodePen
コードは次のとおりです。
<link href="favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="style.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.js"></script>
サムネイルギャラリー
<div class="container">
<div class="row">
<div class="span12">
<ul class="thumbnails">
<li class="span3"><a href="#somo" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
<li class="span3"><a href="#groth" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
<li class="span3"><a href="#gibson" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
<li class="span3"><a href="#baskin" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
</ul>
</div>
<div class="span12">
<ul class="thumbnails">
<li class="span3"><a href="#obrien" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
<li class="span3"><a href="#coh" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
<li class="span3"><a href="#chada" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
<li class="span3"><a href="#panikkar" class="thumbnail" data-toggle="modal"><img src="http://placehold.it/150x150" class="img-polaroid" alt=""></a></li>
</ul>
</div>
</div>
</div>
モーダル
<div id="somo" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Meagan Somo</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
<div id="groth" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Desi Groth</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div><div id="gibson" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Jessie Gibson</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div><div id="baskin" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Connor Baskin</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div><div id="obrien" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Nik O'Brien</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div><div id="coh" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Elizabeth Coh</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div><div id="chada" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Rachel Chada</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div><div id="panikkar" class="modal hide fade" tabindex="-1">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Manoj Panikkar</h3>
</div>
<div class="modal-body">
<p><img src="http://placehold.it/230x270" alt="" class="pull-left">Text here.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
完全なコードについては、 CodePenをチェックしてください。