2017-01-18 3 views
0

Wie funktioniert dieses Snippet?Jquery UI Datepicker funktioniert nicht, solange alles gut aussieht

jQuery(function($) { 
 
    jQuery("#date-from").datepicker(); 
 
});
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> 
 
<script type="text/javascript" src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script> 
 
<input class="from hasDatepicker" id="date-from" type="text" />

Antwort

0

Fügen Sie diese Zeile auf: <link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"/> und entfernen Sie die Klasse hasDatepicker von input Tag so Ihre input Tag <input class="from" id="date-from" type="text" /> sein

$("#date-from").datepicker();
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" /> 
 
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> 
 
<script type="text/javascript" src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script> 
 
<input class="from" id="date-from" type="text" />