码迷,mamicode.com
首页 > 其他好文 > 详细

bootstrap使用汇总

时间:2015-09-14 22:21:56      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

//大多数功能都能够指定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使用汇总

标签:

原文地址:http://www.cnblogs.com/lcchuguo/p/4808158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!