引用的基础文件:
<link rel="stylesheet" href="css/themename/jquery-ui.css" />
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
日期输入框调用案列:
<!doctype html> <html> <head> <Meta charset="utf-8"> <title>jQuery UI 日期选择器(Datepicker) - 默认功能</title> <link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css"> <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script> <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> <link rel="stylesheet" href="jqueryui/style.css"> <script> $(function() { $( "#datepicker" ).datepicker(); }); </script> </head> <body> <p>日期:<input type="text" id="datepicker"></p> </body> </html>
限制日期范围:
<!doctype html> <html> <head> <Meta charset="utf-8"> <title>jQuery UI 日期选择器(Datepicker) - 限制日期范围</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker({ minDate: new Date(2017, 7, 2), maxDate: new Date(2017, 30) }); }); </script> </head> <body> <p>日期:<input type="text" id="datepicker"></p> </body> </html>
官方文档:
http://www.jqueryui.org.cn/demo/5677.html
https://jqueryui.com/