どちらのモーダルポップアップもどちらのボタンをクリックして表示されます
-
21-12-2019 - |
質問
Twitter-BootStrap3.ONボタン「MyBTN」をクリックすると、ID="MyModal"のモーダルがポップアンドオンボタン「MyBTN2」をクリックする必要があります.ID="MyModal2"を使ったモーダルはポップしてください。しかし、私が2つのボタンのいずれかをクリックすると、それらのボットがポップアップします。
サインイン/アップ
<button id="mybtn2" style="display:none;"
class="btn btn-primary btn-lg" href="#signup" data-toggle="modal" data-target=".bs-modal-sm">
Sign In/Up
</button>
<div class="modal fade bs-modal-sm" id="myModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm" >
//code
</div></div>
<div class="modal fade bs-modal-sm" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm" >
//code
</div></div>
. 解決
ターゲットにしたいモードのIDを追加します。現在、data-target
属性は、MODALALSの両方に適用されるbs-modal-sm
のクラスを指しています。必要に応じてdata-target="#myModal"
またはdata-target="#myModal2"
を試してください。
これは起動デモです。リンク
所属していません StackOverflow