どちらのモーダルポップアップもどちらのボタンをクリックして表示されます

StackOverflow https://stackoverflow.com//questions/24045454

質問

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"を試してください。

これは起動デモです。リンク

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top