我开发了一个类型表单,我使用的是datepicker但是在选择日期之后,datepicker auto无法正常工作
$('.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>
&#13;
请问我如何解决这个问题
答案 0 :(得分:0)
我没有在代码段中看到对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>