私はこのwebsiteのいくつかのモーダルウインドウをテストしています。ご覧のとおり、モーダルは再生ボタンをクリック/タッチするとトグルされます。Bootstrap Modal:列全体をクリック可能にする
私の質問は、列全体をクリック可能にしてモーダルを開くことですか?
私は、結果を出さずにdata-targetでdiv全体のデータトグルを定義しようとしました。
これは、HTMLコードです:あなたはそのオープンモーダルクリックであなたが望むあなたのdivのidを割り当て、次のように行うことができます
<!-- Button trigger modal -->
<i class="fa fa-play btn btn-lg" aria-hidden="true" type="button" data-toggle="modal" data-target="#myModal"></i>
</div>
<!-- Modal -->
<div class="modal fade modal-video" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Title 1</h4>
</div>
<div class="modal-body">
<video controls="" width="100%" id="video">
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4">
</video>
<div class="modal-text">
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn button-eh-magenta">Go to Shop</button>
<a href=""><button type="button" class="btn button-eh-magenta">Share</button></a>
</div>
</div>
こんにちは、 :
経由のJavaScript
には、JavaScriptの1行を持つID myModalとモーダルを呼び出します-targetをdivに設定しますが、その結果はモーダルを閉じることができません。 – Roxana
コンソールに何かエラーがありましたか? –
エラーはありません。あなたは一見することができます、私はあなたが示唆したように、最初の列のデータターゲットとデータトグルを適用しました。それはモーダルが終わらないことが起こる。 http://cms.nowcommu.myhostpoint.ch/ – Roxana