简介
jQuery UI Datepicker日期选择插件很好用了,只不过只能精确到日,不能选择时间(小时分钟秒)很遗憾,而jquery-ui-timepicker-addon.js正是基于jQuery UI Datepicker的一款可选时间的插件。
官网地址:http://trentrichardson.com/examples/timepicker/
官网demo下载:https://github.com/trentrichardson/jQuery-Timepicker-Addon
插件效果图:
Demo使用
<html> <head> <title></title> <link type="text/css" href="http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css" rel="stylesheet" /> <link href="jQuery-Timepicker-Addon/jquery-ui-timepicker-addon.css" type="text/css" /> <link href="jQuery-Timepicker-Addon/demos.css" rel="stylesheet" type="text/css" /> <script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.min.js"></script> <script src="jQuery-Timepicker-Addon/jquery-ui-timepicker-addon.js" type="text/javascript"></script> <!--中文--> <script src="js/jquery.ui.datepicker-zh-CN.js.js" type="text/javascript" charset="gb2312"></script> <script src="js/jquery-ui-timepicker-zh-CN.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(function () { // 时间设置 jQuery('#time').datetimepicker({ timeFormat: "HH:mm:ss", dateFormat: "yy-mm-dd" }); }); </script> </head> <body> <input id="time" type="text" /> </body> </html>
项目预览图:
demo代码下载:http://pan.baidu.com/share/link?shareid=125342&uk=590309421
结束
祝:大家每天开心幸福~