bootstrap彈窗、彈出層、modal


 bootstrap彈窗、彈出層、modal

引入bootstrap的js文件    如下div代碼

<div class="modal fade" id="myModal2" style="background-color: #D5D5D5;font-size: .4cm;width: 350px;height: 300px;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" >
        <div class="modal-content">
             <div style="margin-top: 20px;margin-left: 10px;">設置管理密碼</div>
           <div>
                <div style="margin-left: 22px;margin-top: 30px;">
                                              輸入舊密碼<input type="password" id='pswds' placeholder="請輸入舊密碼" autocomplete="off" style="width: 166px;height:30px;border:1px solid transparent;border-radius: 8px;margin-left: 10px;"/>
                </div>
                <div style="margin-left: 22px;margin-top: 10px;">
                                               輸入新密碼<input type="password" id='pswds1' placeholder="請輸入密碼" autocomplete="off" style="width: 166px;height:30px;border:1px solid transparent;border-radius: 8px;margin-left: 10px;"/>
                </div>
                <div style="margin-left: 10px;margin-top: 10px;">
                                               再次輸入密碼<input type="password" id='pswds2' placeholder="請再次輸入密碼" autocomplete="off" style="width: 166px;height:30px;border:1px solid transparent;border-radius: 8px;margin-left: 10px;"/>
                </div>
           </div>
          <div style="clear: both;"></div>
             <div style="width: 100%;margin-top: 20px;" align="center">
                 <input type="button" id="b1" value="登&nbsp;&nbsp;路" onmouseout="seout('b1');"  onmouseover="seover('b1');" onclick="save2();" style="background-color:#1C86EE;width:88px;height: 38px;color: white;padding-left: 0px;border: 1px solid transparent;outline: none;border-radius: 6px;"/>
                 &nbsp;&nbsp;&nbsp;&nbsp;
                 <input type="button" id="b2" value="取&nbsp;&nbsp;消" onmouseout="seout('b2');"  onmouseover="seover('b2');" onclick="myModalClo2();" style="background-color:#1C86EE;width:88px;height: 38px;color: white;padding-left: 0px;border: 1px solid transparent;outline: none;border-radius: 6px;"/>
             </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
  $('#myModal3').modal('show');
   $('#myModal3').modal('hide');

 開始關閉觸發事件

        $('#myModal').on('hide.bs.modal', function () {
              // 執行一些動作...
              $("#myModal").css("pointer-events","none");
            })
                
        $('#myModal').on('show.bs.modal', function () {
          // 執行一些動作...
            $("#myModal").css("pointer-events","auto");
        })

 防止點擊其他地方關閉彈窗問題

加上如下標簽即可

data-backdrop="static"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM