MultiDatesPicker for jQuery UI is not showing

孤街浪徒 提交于 2021-01-29 11:58:52

问题


I am using MultiDatesPicker for jQuery UI, but the datepicker is not showing. Please help.

Here with my code:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="Multiple-Dates-Picker-for-jQuery-UI-latest/jquery-ui.multidatespicker.css">
<script src="Multiple-Dates-Picker-for-jQuery-UI-latest/jquery-ui.multidatespicker.js"></script>

<script>


$(document).ready(function(){
   $('#mdp-demo').multiDatesPicker();
});
</script>

<style>
    body { height: 400px; }
    </style>

</head>
<body>

<input id="mdp-demo">

</body>
</html>

回答1:


As shown in the Input field usage example you have to include

  • jquery.min.js (2.2.4)
  • jquery-ui.multidatespicker.css
  • jquery-ui.css
  • jquery-ui.multidatespicker.js
  • jquery-ui.min.js

Example (copied from the link above)

$( document ).ready(function() {
    $('#mdp-demo').multiDatesPicker();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<link href="https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.css" rel="stylesheet"/>
<link href="https://code.jquery.com/ui/1.12.1/themes/pepper-grinder/jquery-ui.css" rel="stylesheet"/>
<script src="https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<input id="mdp-demo">



回答2:


You have not included style sheet link for date picker get style link from documentation hopefully it will solve your problem if not letme know



来源:https://stackoverflow.com/questions/57527634/multidatespicker-for-jquery-ui-is-not-showing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!