changeMonth 和 changeYear 選擇可以打開和關(guān)閉月份和年份下拉選擇框。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Demos</title>
<link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
<script src="scripts/jquery-1.9.1.js"></script>
<script src="scripts/jquery-ui-1.10.1.custom.js"></script>
<script>
$(function () {
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true
});
});
</script>
</head>
<body>
<p>
Date:
<input type="text" id="datepicker" />
</p>
</body>
</html>
http://wiki.jikexueyuan.com/project/jquery-tutorial/images/34.png" alt="" />
選項 numberOfMonths 可以用控制同時顯示幾個月份:
$(function () {
$("#datepicker").datepicker({
numberOfMonths: 3,
showButtonPanel: true
});
});
http://wiki.jikexueyuan.com/project/jquery-tutorial/images/35.png" alt="" />