1. 程式人生 > >Bootstrap模態框修改出現的位置和大小

Bootstrap模態框修改出現的位置和大小

title 大小 LG pos class -- clas content 位置

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"> 
    <title>Bootstrap 實例 - 模態框(Modal)插件事件</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"
></script> <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <!--修改模態框 出現的位置--> <style type="text/css"> .modal.fade.in{ top:90px; } </style> <body> <h2>模態框(Modal)插件事件</h2> <!--
按鈕觸發模態框 --> <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 開始演示模態框 </button> <!-- 模態框(Modal) --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"
style="width:100%;height:100px;"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">× </button> <h4 class="modal-title" id="myModalLabel"> 模態框(Modal)標題 </h4> </div> <div class="modal-body"> 點擊關閉按鈕檢查事件功能。 </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal"> 關閉 </button> <button type="button" class="btn btn-primary"> 提交更改 </button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <script> $(function () { $(#myModal).modal(hide)}); </script> <script> $(function () { $(#myModal).on(hide.bs.modal, function () { //alert(‘嘿,我聽說您喜歡模態框...‘);}) }); </script> </body> </html>

Bootstrap模態框修改出現的位置和大小