2016-10-01 241 views
0

我開發我在哪裏使用日期選擇一種形式之後,但選擇日期後,日期選擇器自動工作不日期選擇器自動關閉選擇日期不工作

$('.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>

請問我可以如何解決這個問題

回答

0

我沒有看到任何引用pickadate庫的主題CSS文件在您的片段。它autoclosing對我來說,一旦我加入他們

$('.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>