• 【Select2】带搜索框的下拉框美化插件


    1  引入js css 文件

    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/select2.full.js"></script>
    <link href="css/select2.css" rel="stylesheet" type="text/css">

    2 html 代码:

    <!DOCTYPE html>
    <html>
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>演示</title>
        <script src="js/jquery-1.11.1.min.js"></script>
         <script src="js/select2.full.js"></script>
         <link href="css/select2.css" rel="stylesheet" type="text/css">
      </head>
      <body>
    
      <div style="text-align:center;">
      <h2>select2 - 带搜索的下拉框演示</h2>
      <br/>
        <select id='ss'>
          <option value="richerdyoung">richerdyoung</option>
        </select>
       </div>
        <script>
          //本地数据获取    
          var data = [{ id: 'php', text: 'php' }, { id: 'python', text: 'python' }, { id: 'go', text: 'go' }];
          $("#ss").select2({
           data: data,
           placeholder:'请选择',
           allowClear:true
          })
        </script>
      </body>
    </html>

    效果如下: 

    演示地址:  https://www.richerdyoung.cn/select2/

     git 地址: https://github.com/select2/select2/releases

  • 相关阅读:
    sprintf的用法
    sscanf
    Decode the tape
    poj 1579 Function Run Fun
    Where's Waldorf?
    uva Andy's First Dictionary
    UVA Hangman Judge
    UVa Automatic Editing
    界面设计规范
    web标准下的web开发流程思考
  • 原文地址:https://www.cnblogs.com/richerdyoung/p/7239270.html
Copyright © 2020-2023  润新知