bootstrap使用总结
发布时间:2020-12-17 21:09:32 所属栏目:安全 来源:网络整理
导读://大部分的功能都是可以通过指定data属性来指定 但是事件就必须用jquery因为事件都是不同的处理过程 //事件一般都有两种状态show shown 一般和过去 !DOCTYPE html html lang="en" ? head ? ? titleBootstrap 101 Template/title ? ? meta name="viewport" co
//大部分的功能都是可以通过指定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>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |