zoukankan      html  css  js  c++  java
  • Bootstrap3模态垂直居中

    
    
    1     <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    2         <div class="modal-dialog modal-lg">
    3             <div class="modal-content"></div><!-- /.modal-content -->
    4         </div><!-- /.modal -->
    5     </div>
    
    
    1         function openDialog() {
    2             var modal = $('#myModal').modal({ keyboard: false, backdrop: 'static'/*,remote: 'Detail?r=' + Math.random()*/ })
    3             modal.find('.modal-content').load('Detail', { R: Math.random() });
    4         }

    1
    $(function () { 2 function centerModals() { 3 $('#myModal').each(function (i) { 4 var $clone = $(this).clone().css('display', 'block').appendTo('body'); 5 var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2); 6 top = top > 0 ? top : 0; 7 $clone.remove(); 8 $(this).find('.modal-content').css("margin-top", top); 9 }); 10 } 11 if ($('#myModal').size() > 0) { 12 //$('#myModal').on('shown.bs.modal', centerModals); 13 //$(window).on('resize', centerModals); 14 setInterval(centerModals, 200); 15 } 16 });
  • 相关阅读:
    [CTF]跳舞的小人
    [CTF]Rabbit加密
    [CTF]ROT5/13/18/47编码
    [CTF]URL编码
    [CTF]unicode编码
    [CTF]培根密码
    电机控制总结
    stm32f4定时器配置
    MOS管测量好坏测量方法
    四元数
  • 原文地址:https://www.cnblogs.com/ToughGuy/p/4519980.html
Copyright © 2011-2022 走看看