【问题标题】:Jquery datepicker is getting overlapped by inputJquery datepicker被输入重叠
【发布时间】:2016-05-25 01:12:25
【问题描述】:

As you can see in the image the Jquery datepicker is overlapped by input

input 是一个 Kartik Krajee bootstrap 照片上传插件[link:http://plugins.krajee.com/file-input/demo]

HTML

  <input id="file-0a" class="file" name="file" type="file" size="" multiple data-min-file-count="1">

Jquery 日期选择器

     <input id="datepicker" type="text" name="dob" class="form-control"  placeholder="Date of Birth">
           <?php
     $year = date('Y');
       ?>

 <script>

  $(function() {
    $( "#datepicker" ).datepicker({changeYear:true, yearRange: '<?php echo $year-70; ?>:<?php echo $year-10; ?>'});
          });

  </script>

照片上传输入与日历重叠,如您所见,任何人都可以解决这个问题吗??

【问题讨论】:

  • 我确实通过检查元素添加了 z-index:0px 并且确实有效,但我不知道在文件中添加的位置
  • 您可以通过 css 规则添加它并将 z-index: 0px 应用到类/id 中,或者为该元素执行内联 css,例如 style="z-index: 0px"
  • 我做了但没用

标签: javascript jquery html twitter-bootstrap datepicker


【解决方案1】:

首先,找到 datepicker 容器 css 类。使用 Chrome 开发者工具有一种简单的方法可以做到这一点。当然,在日期选择器打开时右键单击它,然后在 Chrome 中单击“检查”。您可以看到显示日期选择器的根(或容器)html 元素。取它的类(或 id)并应用下面的 css 规则。

#datepicker-container-or-something {
 z-index:9999 !important;
}

【讨论】:

    猜你喜欢
    • 2017-05-19
    • 2020-07-25
    • 1970-01-01
    • 1970-01-01
    • 2017-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多