• BootStrap实例


    S1.html

    <!DOCTYPE html>
    <html>
    <head>
       <meta charset="UTF-8">
       <title>Checkbox in DataList - jQuery EasyUI Demo</title>
       <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
       <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
       <link rel="stylesheet" type="text/css" href="../demo.css">
       <script type="text/javascript" src="../../jquery.min.js"></script>
       <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
    </head>
    <body>
       <h2>Checkbox in DataList</h2>
       <p>Each item in the DataList has a checkbox.</p>
       <div style="margin:20px 0"></div>
       <div class="easyui-datalist" title="Checkbox in DataList" style="width:400px;height:250px" data-options="
             url: 'datalist_data1.json',
             method: 'get',
             checkbox: true,
             selectOnCheck: false,
             onBeforeSelect: function(){return false;}
             ">
       </div>
    </body>
    </html>

    S2.html

    <!DOCTYPE html>
    <html>
    <head>
       <meta charset="UTF-8">
       <title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
       <link rel="stylesheet" type="text/css" href="jquery-easyui-1.7.0/themes/default/easyui.css">
       <link rel="stylesheet" type="text/css" href="jquery-easyui-1.7.0/themes/icon.css">
       <link rel="stylesheet" type="text/css" href="jquery-easyui-1.7.0/themes/color.css">
       <link rel="stylesheet" type="text/css" href="jquery-easyui-1.7.0/demo/demo.css">
       <script type="text/javascript" src="jquery-easyui-1.7.0/jquery.min.js"></script>
       <script type="text/javascript" src="jquery-easyui-1.7.0/jquery.easyui.min.js"></script>
    </head>
    <body>
       <h2>Basic CRUD Application</h2>
       <p>Click the buttons on datagrid toolbar to do crud actions.</p>

       <table id="dg" title="My Users" class="easyui-datagrid" style="width:700px;height:250px"
             url="get_users.php"
             toolbar="#toolbar" pagination="true"
             rownumbers="true" fitColumns="true" singleSelect="true">
          <thead>
             <tr>
                <th field="firstname" width="50">First Name</th>
                <th field="lastname" width="50">Last Name</th>
                <th field="phone" width="50">Phone</th>
                <th field="email" width="50">Email</th>
             </tr>
          </thead>
       </table>
       <div id="toolbar">
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newUser()">New User</a>
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">Edit User</a>
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()">Remove User</a>
       </div>

       <div id="dlg" class="easyui-dialog" style="width:400px" data-options="closed:true,modal:true,border:'thin',buttons:'#dlg-buttons'">
          <form id="fm" method="post" novalidate style="margin:0;padding:20px 50px">
             <h3>User Information</h3>
             <div style="margin-bottom:10px">
                <input name="firstname" class="easyui-textbox" required="true" label="First Name:" style="width:100%">
             </div>
             <div style="margin-bottom:10px">
                <input name="lastname" class="easyui-textbox" required="true" label="Last Name:" style="width:100%">
             </div>
             <div style="margin-bottom:10px">
                <input name="phone" class="easyui-textbox" required="true" label="Phone:" style="width:100%">
             </div>
             <div style="margin-bottom:10px">
                <input name="email" class="easyui-textbox" required="true" validType="email" label="Email:" style="width:100%">
             </div>
          </form>
       </div>
       <div id="dlg-buttons">
          <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveUser()" style="width:90px">Save</a>
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancel</a>
       </div>
       <script type="text/javascript">
          var url;
          function newUser(){
             $('#dlg').dialog('open').dialog('center').dialog('setTitle','New User');
             $('#fm').form('clear');
             url = 'save_user.php';
          }
          function editUser(){
             var row = $('#dg').datagrid('getSelected');
             if (row){
                $('#dlg').dialog('open').dialog('center').dialog('setTitle','Edit User');
                $('#fm').form('load',row);
                url = 'update_user.php?id='+row.id;
             }
          }
          function saveUser(){
             $('#fm').form('submit',{
                url: url,
                onSubmit: function(){
                   return $(this).form('validate');
                },
                success: function(result){
                   var result = eval('('+result+')');
                   if (result.errorMsg){
                      $.messager.show({
                         title: 'Error',
                         msg: result.errorMsg
                      });
                   } else {
                      $('#dlg').dialog('close');    // close the dialog
                      $('#dg').datagrid('reload');   // reload the user data
                   }
                }
             });
          }
          function destroyUser(){
             var row = $('#dg').datagrid('getSelected');
             if (row){
                $.messager.confirm('Confirm','Are you sure you want to destroy this user?',function(r){
                   if (r){
                      $.post('destroy_user.php',{id:row.id},function(result){
                         if (result.success){
                            $('#dg').datagrid('reload');   // reload the user data
                         } else {
                            $.messager.show({  // show error message
                               title: 'Error',
                               msg: result.errorMsg
                            });
                         }
                      },'json');
                   }
                });
             }
          }
       </script>
    </body>
    </html>

    S3.html

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            .c1{
                background-color: red;
                height:50px;
            }
            /*当屏幕的最小宽度大于700px时 media里面的才生效*/
            @media (min-width: 700px) {
                .c2{
                background-color: grey;
                    }
            }

        </style>
    </head>
    <body>
        <div class="c1 c2"></div>
    </body>
    </html>

    <!--参考 v3.bootstrap 组件--默认样式的导航条-->

    S4.html

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            .no-radius{
                border-radius: 0 !important;
            }
            /*/important css永远生效,不会覆盖*/
        </style>
        <link rel="stylesheet" href="BootStrap/bootstrap-3.3.7-dist/css/bootstrap.css">
        <link rel="stylesheet" href="BootStrap/bootstrap-3.3.7-dist/css/bootstrap-theme.css">

    </head>
    <body style="background-color: red">
        <span class="glyphicon glyphicon-home" aria-hidden="true"></span>

        <!-- Single button -->
    <div class="btn-group">
      <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        Action <span class="caret"></span>
          <!--btn-primary 蓝色 btn-default 白色 btn-success 绿色 btn-warning-->
      </button>
      <ul class="dropdown-menu">
        <li><a href="#">Action</a></li>
        <li><a href="#">Another action</a></li>
        <li><a href="#">Something else here</a></li>
        <li role="separator" class="divider"></li>
        <li><a href="#">Separated link</a></li>
      </ul>
    </div>

        <!--默认有圆角,要去圆角-->
        <nav class="navbar navbar-default no-radius" >
      <div class="container-fluid">
         <!--Brand and toggle get grouped for better mobile display-->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Brand</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
            <li><a href="#">Link</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">Separated link</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
          <form class="navbar-form navbar-left">
            <div class="form-group">
              <input type="text" class="form-control" placeholder="Search">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
          </form>
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Link</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">Separated link</a></li>
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container-fluid -->
    </nav>

        <script src="BootStrap/jquery-1.12.4.js"></script>
        <script src="BootStrap/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    </body>
    </html>

    S5.html

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            .img{
                width:100%;
                height: 500px;
            }
        </style>
        <link rel="stylesheet" href="bxslider/jquery.bxslider/jquery.bxslider.css">
    </head>
    <body>
        <ul class="bxslider">
            <li><img class='img' src="bxslider/jquery.bxslider/images/1.jpg"></li>
            <li><img class='img' src="bxslider/jquery.bxslider/images/2.jpg"></li>
            <li><img class='img' src="bxslider/jquery.bxslider/images/3.jpg"></li>
            <li><img class='img' src="bxslider/jquery.bxslider/images/4.jpg"></li>
            <li><img class='img' src="bxslider/jquery.bxslider/images/5.jpg"></li>
        </ul>
        <script src="bxslider/jquery.bxslider/jquery-1.12.4.js"></script>
        <script src="bxslider/jquery.bxslider/jquery.bxslider.js"></script>
        <script>
            $(document).ready(function(){
                $('.bxslider').bxSlider({
                    auto: true, // true, false - 自动播放
                    speed: 2000,//切换图片时间 ms
                });
             });
    //        $(function () {
    //        })
        </script>
    </body>
    </html>
    <!--幻灯片播放控制参考https://www.cnblogs.com/jghgo/p/8203561.html-->

  • 相关阅读:
    jQuery技巧总结
    IBatis.NET框架
    武林足球Ajax全站的核心JS
    Lucene入门与使用(2)转
    图片预加载
    构建基于词典的Lucene分析器
    利用system表来注入
    查看执行后的HTML代码,方便调试
    每日英语
    关于URL的地址重写,自己也实验了一把!
  • 原文地址:https://www.cnblogs.com/leiwenbin627/p/10964631.html
Copyright © 2020-2023  润新知