イメージサムネイルを作成し、そのサムネイルを次のコードを使用してリンクしました。モーダルにナビゲーションボタン(前後)を追加する方法
<!DOCTYPE html>
<html>
<head>
\t \t <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
\t \t <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
\t \t <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel='stylesheet' type='text/css' />
\t \t
</head>
<body>
\t \t <!--thumbnail section-->
\t \t <section class="container">
\t \t \t <div class="row add-bottom text-center">
\t \t \t \t <a href="#migrant" class="thumbnail" data-toggle="modal">
\t \t \t \t \t <img src=".." alt="Project Image" class="img-responsive center-block">
\t \t \t \t </a>
\t \t \t \t <br />
\t \t \t \t <br />
\t \t \t \t <a href="#water" class="thumbnail" data-toggle="modal">
\t \t \t \t \t <img src=".." alt="Project Image1" class="img-responsive center-block">
\t \t \t \t </a>
\t \t \t </div>
\t \t </section>
\t \t
\t \t <!--Modal Content-->
\t \t <div class="modal fade" id="migrant" role="dialog">
\t \t \t <div class="modal-dialog">
\t \t \t \t
\t \t \t \t <div class="modal-content">
\t \t \t \t \t <div class="modal-header">
\t \t \t \t \t \t
\t \t \t \t \t \t <h3>Migrants</h3>
\t \t \t \t \t \t <button type="button" class="close" data-dismiss="modal">x</button>
\t \t \t \t \t </div>
\t \t \t \t \t <div class="modal-body">
\t \t \t \t \t \t <div class="modal-footer txt_center">
\t \t \t \t \t \t \t <p>
\t \t \t \t \t \t \t \t <img src=".." alt="migrant01" class="pull-right">The Grapes of Wrath is an Amer list novel written by John Steinbeck and published in 1939. The book won the National Book Award and Pulitzer Prize for fiction, and it was cited prominently when Steinbeck was awarded the Nobel Prize in 1962
\t \t \t \t \t \t \t </p>
\t \t \t \t \t \t </div>
\t \t \t \t \t </div>
\t \t \t \t \t <div class="modal-footer">
\t \t \t \t \t \t <button class="btn" data-dismiss="modal">Close</button>
\t \t \t \t \t </div>
\t \t \t \t </div>
\t \t \t </div>
\t \t </div>
\t \t <div class="modal fade" id="water" role="dialog">
\t \t \t <div class="modal-dialog">
\t \t \t \t
\t \t \t \t <div class="modal-content">
\t \t \t \t \t <div class="modal-header">
\t \t \t \t \t \t <h3>Water</h3>
\t \t \t \t \t \t <button type="button" class="close" data-dismiss="modal">x</button>
\t \t \t \t \t </div>
\t \t \t \t \t <div class="modal-body">
\t \t \t \t \t \t <div class="modal-footer txt_center">
\t \t \t \t \t \t \t <p>
\t \t \t \t \t \t \t \t <img src=".." alt="water01" class="pull-right">The Orchidaceae are a diverse and widespread family of flowering plants, with blooms that are often colourful and often fragrant, commonly known as the orchid family. Along with the Asteraceae, they are one of the two largest families of flowering
\t \t \t \t \t \t \t \t plants. The Orchidaceae have about 27,800 currently accepted species, distributed in about 880 genera
\t \t \t \t \t \t \t </p>
\t \t \t \t \t \t </div>
\t \t \t \t \t </div>
\t \t \t \t \t <div class="modal-footer">
\t \t \t \t \t \t <button class="btn" data-dismiss="modal">Close</button>
\t \t \t \t \t </div>
\t \t \t \t </div>
\t \t \t </div>
\t \t </div>
</body>
</html>
今、私は画像を記述する段落と一緒に画像を表示するモーダルウィンドウに(前後の)ナビゲーションボタンを追加したいです。 モーダルウィンドウが表示されたら、ウィンドウを閉じてサムネイル画像に何度も何度も戻ってくる必要はありません。モーダルウィンドウが表示されたら、目的の画像を探したいナビゲーションボタンをその説明と共に追加します。 これはどうすれば可能でしょうか?
を私は上記のコードが、私を試してみましたPlunker.Moreoverに表示される結果と同じではない、いくつかの望ましくない結果(複数のサムネイルとモーダルが一度に表示されています)が発生しています。また、Plunkerにおいても、指定されたサムネ対応するモーダルが表示されていない場合は、デフォルトで最初のモーダルが表示されます。最初/最後のモーダルに達すると前/次のボタンを消したい。モーダルフッタにボタンを持つ代わりにモーダルボディのナビゲーション矢印を使用する方法は、前/次のモーダルにリダイレクトされますか? –
私は、他の機能を追加するための回答を更新して、それが常にクリックの最初の項目を示した問題を修正しました。コードをそのまま使用すると、動作します。 jQueryとBootstrapについて理解を深めるためにオンラインでいくつかのコースを探すことをお勧めします。 – WonderGrub