固定的div在select2下拉菜单时无法滚动

时间:2019-07-12 04:40:00

标签: javascript jquery html css jquery-select2

我在可滚动的固定div弹出窗口(如模式窗口)中有select2。在select2下拉列表中,只有先关闭下拉列表,才能滚动div。

它使智能手机键盘挡住了选择,但我无法滚动它。当select2下拉菜单时,如何使固定的div仍可滚动。

这是我的小提琴 https://jsfiddle.net/rezaiskandar/d8cu9ywf/34/

<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/css/select2.css" rel="stylesheet" />
<div class="fixed">
  <div class="content">
    <div class="content">
      <select class="selectt" name="hehe">
        <option value="" selected>choice 1</option>
        <option value="">choice 2</option>
        <option value="">choice 3</option>                                 </select>
    </div>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </p>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </p>
  </div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>

1 个答案:

答案 0 :(得分:0)

那是因为您正在使用position: fixed修复容器 如果您共享所需的设计,那么我将了解实际需求是什么。