bootstrap使用總結

來源:互聯網
上載者:User

標籤:style   http   os   使用   io   ar   div   cti   html   

//大部分的功能都是可以通過指定data屬性來指定 但是事件就必須用jquery因為事件都是不同的處理過程
//事件一般都有兩種狀態show shown 一般和過去


<!DOCTYPE html>
<html lang="en">


  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">


      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
      </script>
      <script>
          $(document).ready(function(){
              $("p").click(function(){
                  $(this).hide();
              });
              //通過編寫jquery 來展示效果,方法和事件的使用
              //$("#myModal").modal({show:true,backdrop:true});
              $(‘#myModal‘).on(‘shown‘, function () {
                  alert("hahjah");
              })
          });
      </script>


  </head>
  <body>


//通過data屬性來查看效果
<!-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">查看示範案例</a>
//指定data屬性data-backdrop backdrop是一個選擇性參數,可以看文檔還有很多有用的屬性
<button type="button" data-backdrop="false" data-toggle="modal" data-target="#myModal">Launch modal</button>
<!-- Modal -->
<div id="myModal"  class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Modal header</h3>
    </div>
    <div class="modal-body">
        <p>One fine body…</p>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">關閉</button>
        <button class="btn btn-primary">Save changes</button>
    </div>
</div>
<p>如果您點擊我,我會消失。</p>


<!--***************************************************************************-->
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

bootstrap使用總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.