使用jquery加原生html+css+javascript实现一个树形下拉

2023-12-17

<!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">
  <title>Document</title>
  <script src="./jquery.min.js"></script>
  <style>
    body {
      margin: 0;
      padding: 0;
    }

    .father {
      max-width: 500px;
      margin: 0 auto;
      background-color: #fff;
      padding: 10px;
    }

    #inputid {
      width: 60%;
      height: 30px;
    }

    ul {
      list-style-type: none;
      padding: 0;
    }

    #dataul {
      position: fixed;
      background-color: #ffffff;
      z-index: 999;
      margin-top: 5px;
      width: 50%;
      height: 200px;
      display: none;
      border: 1px solid #ebebeb;
      overflow: scroll;
      box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    #dataul .arrowfather {
      margin-top: 5px;
      position: relative;
    }



    /* 三角形 */
    .cascader-arrow {
      position: absolute;
      top: 50%;
      left: 12px;
      transform: translateY(-50%);
      width: 0;
      height: 0;
      border-top: 7px solid transparent;
      border-bottom: 7px solid transparent;
      border-left: 7px solid #999;
      cursor: pointer;
    }

    .arrow-rotate {
      transform: translateY(-50%) rotate(90deg);
    }

    .cascader-text {
      margin-left: 30px;
      width: 100%;
      display: inline-block;
    }

    .arrowfather:hover {
      background-color: #f5f7fa;
    }

    .sonul {
      display: none;
    }
  </style>
</head>

<body>
  <div class="father">
    <div class="select">
      <input type="text" name="inputname" id="inputid" class="selectinput" onfocus="setfocus(this)"
        oninput="setinput(this);" plac
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用jquery加原生html+css+javascript实现一个树形下拉 的相关文章

随机推荐