81497307 2014-08-28
DatePicker.html
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Default functionality</title> <script src="jquery/jquery-1.8.3.js"></script> <script src="jquery-ui/js/jquery-ui-1.9.2.js"></script> <script src="jquery-ui/js/jquery.ui.datepicker-zh-CN.js" type="text/javascript" charset="gb2312"></script> <link rel="stylesheet" href="jquery-ui/css/custom-theme/jquery-ui-1.9.2.css"></link> <script> $(function() { $( "#datepicker" ).datepicker(); }); /* $(function() { $("#datepicker").datepicker( { changeMonth : true, changeYear : true }); }); */ </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>
运行结果:
如果要设置下拉的年、月,设置changeMonth、changeYear为true即可,如上注释的代码。
.ui-datepicker{width:17em;padding:.2em.2em0;display:none;font-size:大小}可惜我试了不起作用。我试着用js加载后改,发现成功了!!!!