【问题标题】:Jquery UI Datepicker not working while everything looks fineJquery UI Datepicker 不工作,而一切看起来都很好
【发布时间】:2017-01-18 10:59:33
【问题描述】:

如何使这个 sn-p 工作?

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" />

【问题讨论】:

    标签: jquery-ui datepicker jquery-ui-datepicker uidatepicker


    【解决方案1】:

    在顶部添加这一行:&lt;link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"/&gt; 并从 input 标记中删除 hasDatepicker 类,这样您的 input 标记将变为 &lt;input class="from" id="date-from" type="text" /&gt;

    $("#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" />

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-06
      相关资源
      最近更新 更多