gpt4 book ai didi

javascript - 选择日期后日期选择器自动关闭不起作用

转载 作者:行者123 更新时间:2023-11-28 05:06:27 25 4
gpt4 key购买 nike

我开发了一个类型表单,我在其中使用了日期选择器,但是在选择日期之后,日期选择器自动不起作用

 $('.datepicker').pickadate({
selectMonths: true, // Creates a dropdown to control month
selectYears: 15 // Creates a dropdown of 15 years to control year
});

$('select').material_select();
.form-control {
display: block;
width: 100%;
height: 42px;
padding: .5714285714285714rem;
font-size: 14px;
line-height: 1.42857;
color: #464646;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
-webkit-border-radius: 0;
border-radius: 0;
outline: none;
-webkit-transition: border-color 0.3s, box-shadow 0.3s;
-o-transition: border-color 0.3s, box-shadow 0.3s;
transition: border-color 0.3s, box-shadow 0.3s;
}
            <div class="input-group noEnter">
<label for="basic-url">Date of birth</label>
<input type="text" class="form-control datepicker" placeholder="" aria-describedby="basic-addon1"> </div>

请问我该如何解决这个问题

最佳答案

我在您的代码段中没有看到任何对 pickadate 库的主题 CSS 文件的引用。一旦我添加它们,它就会自动关闭

$('.datepicker').pickadate({
selectMonths: true, // Creates a dropdown to control month
selectYears: 15 // Creates a dropdown of 15 years to control year
});
.form-control {
display: block;
width: 100%;
height: 42px;
padding: .5714285714285714rem;
font-size: 14px;
line-height: 1.42857;
color: #464646;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
-webkit-border-radius: 0;
border-radius: 0;
outline: none;
-webkit-transition: border-color 0.3s, box-shadow 0.3s;
-o-transition: border-color 0.3s, box-shadow 0.3s;
transition: border-color 0.3s, box-shadow 0.3s;
}
<link rel="stylesheet" href="https://rawgit.com/amsul/pickadate.js/master/lib/compressed/themes/default.css">
<link rel="stylesheet" href="https://rawgit.com/amsul/pickadate.js/master/lib/compressed/themes/default.date.css">


<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://rawgit.com/amsul/pickadate.js/master/lib/compressed/picker.js"></script>
<script src="https://rawgit.com/amsul/pickadate.js/master/lib/compressed/picker.date.js"></script>
<div class="input-group noEnter">
<label for="basic-url">Date of birth</label>
<input type="text" class="form-control datepicker" placeholder="" aria-describedby="basic-addon1">
</div>

关于javascript - 选择日期后日期选择器自动关闭不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39807450/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com