在页面加载时创建模态框

时间:2017-04-30 17:37:45

标签: modal-dialog load box

我想在我的网页上插入此模态框,但我没有此代码的CSS:

http://www.bootply.com/testazoid/14LH4kZul2#

2 个答案:

答案 0 :(得分:0)

来自bootstrap的这个模态。你需要bootstrap JS和CSS

参考此https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_modal&stacked=h

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  
  <script>
    $(document).ready(function(){
      $('#myModal').modal('show');
    });
  </script>
  

<div class="container">
  <h2>Modal Example</h2>
  <!-- Trigger the modal with a button -->
  <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>

  <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Modal Header</h4>
        </div>
        <div class="modal-body">
          <p>Some text in the modal.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
      
    </div>
  </div>
  
</div>

答案 1 :(得分:0)

你可能正在寻找这个

[ 0 0 1; 0 1 2; 1 2 3]