jquery实现一个多功能下拉选择框效果代码

代码语言:html

所属分类:表单美化

代码描述:jquery实现一个多功能下拉选择框效果代码,实现了模糊查找选择、数据懒加载、上下选择操作等功能。

代码标签: 多功能 下拉 选择 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/ionicons.css">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/multiFunctionSelect.css">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
  </head>
  <body>
    <div class="container clearfix">
      <div class="leftContent">
        <h3>目前提供的下拉选项功能:</h3>
          <div class="demoView clearfix">
            <div class="demoTitle">普通下拉框(arrow):</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo0" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">普通下拉框(triangle):</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo1" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持输入筛选且不区分大小写的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo2" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持输入筛选且区分大小写的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo3" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持输入筛选且输入值左匹配的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo4" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持输入筛选且输入值右匹配的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo5" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持输入筛选且含有输入值匹配的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo6" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持回车选中部分匹配的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo7" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持回车选中全匹配的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo8" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持输入后才展示选项列表:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo9" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持前端自动添加全部选项:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo10" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持默认选中某选项:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo11" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
          <div class="demoView clearfix">
            <div class="demoTitle">支持懒加载的下拉框:</div>
            <div class="selectSearchArea multiFunctionSelectArea">
              <input class="multiFunctionSelect" id="demo12" placeholder="请选择" type="text"  autocompvare="off"/>
            </div>
          </div>
      </div>
      <div class="rightContent">
        <h3>目前提供的回调及方法:</h3>
        <div class="demoView clearfix">
          <div class="demoTitle">回车、选中触发回调:</div>
          <div class="selectSearchArea multiFunctionSelectArea">
            <input class="multiFunctionSelect" id="demo13" placeholder="请选择" type="text"  autocompvare="off"/>
          </div>
        </div>
        <div class="demoView clearfix">
          <div class="demoTitle">测试方法:</div>
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0