2017-05-26 225 views
0

我使用的是附加VOOR引導爲能夠與一個datepicker工作:https://bootstrap-datepicker.readthedocs.io/en/latest在線日期選擇器引導

連接到輸入字段時,它的工作原理沒有問題。

現在我試圖使它作爲內嵌可見,我ahev試圖找出代碼使用此工具:https://uxsolutions.github.io/bootstrap-datepicker/?markup=embedded&format=dd-mm-yyy&weekStart=&startDate=&endDate=&startView=0&minViewMode=0&maxViewMode=4&todayBtn=false&clearBtn=false&language=nl&orientation=auto&multidate=&multidateSeparator=&calendarWeeks=on&todayHighlight=on&keyboardNavigation=on&forceParse=on#sandbox

出於某種原因,西港島線沒有顯示出來。有什麼建議麼?

<div id="calendar"></div> 

<!-- Datepicker --> 
    <script src="includes/js/bootstrap-datepicker.js"></script> 
    <script src="includes/js/bootstrap-datepicker.nl.min.js"></script> 
    <script type="text/javascript"> 
    $('#sandbox-container calendar').datepicker({ 
    language: "nl", 
    calendarWeeks: true, 
    todayHighlight: true 
    }); 
    </script> 

回答

1

機會是你引用在演示現場,你可能在你的標記沒有使用#sandbox-container。更新jQuery選擇指向您的佔位符<div>(例如#calendar)的ID - 見下文:

$('#calendar').datepicker({ 
 
    language: "nl", 
 
    calendarWeeks: true, 
 
    todayHighlight: true 
 
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/locales/bootstrap-datepicker.nl.min.js"></script> 
 
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.standalone.min.css" rel="stylesheet"/> 
 

 
<div id="calendar"></div>