直接看代码:
代码中引用的所有js文件已打包(见附件1)。jquery-1.6.2.js除外。因为这个跟datepicker没直接关系。
如果想显示中文,直接加上附件2,就行了。
Java代码
<script src="../jquery-ui/jquery-1.6.2.js">
<script src="../jquery-ui/jquery.ui.core.js">
<script src="../jquery-ui/jquery.ui.widget.js">
<script src="../jquery-ui/jquery.ui.datepicker.js">
<script src="../jquery-ui/jquery.ui.datepicker-zh-CN.js">
<script>
$(function() {
$("#datepicker" ).datepicker();
});
$(document).ready(function(){
//alert("fs");
//$("#datepicker" ).datepicker();
$("#button").click(function(){
alert($("#datepicker").val());
});
});
一些参数设置:
Java代码
$("#datepicker").datepicker({
minDate: new Date()
});
作者“郑星阳”