当前位置: 首页 > 图文教程 > 网络编程 > Javascript > jquery UI 1.72 之datepicker

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 jquery UI 1.72 之datepicker


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 493 ::
收藏到网摘: n/a

一步一步学jquery UI 1.72 之datepicker,中间都写了注释方便大家学习。
复制代码 代码如下:

<script type="text/javascript">
$(function() {
var options = {
changeMonth: true, //显示月份下拉框
changeYear: true, //显示年份下拉框
firstDay: 0, //第一天的索引(星期天放前面)(星期天到星期六对应的索引为:0~6)
showOtherMonths: true, //显示其他月份的日期
showMonthAfterYear: false, //年份下拉框放在月份下拉框的前面还是后面
prevText: "上一月", //跳转到上一页的提示文本
nextText: '下一月', //跳转到下一页的提示文本
stepMonths: 2, //每点击一次“上一月”或者“下一月”,移动2个月
navigationAsDateFormat: true,
showCurrentAtPos: 3, //离当前月偏移3个月
showOn: 'both',
//minDate/maxDate/hideIfNoPrevNext为一组
minDate:'-10', //
maxDate: '35',
hideIfNoPrevNext: false, //据说是禁止使用prev 和next ,必须配合maxDate和minDate使用
// defaultDate: 2, //设置当前日期
gotoCurrent: true,
numberOfMonths: 2, //一次显示2个月(2个日历)
yearRange: '2009:2019' //显示可选的年份
};
//初始化日期控件
$('#datePicker').datepicker(options);
//显示当前日期
$('#datePicker').datepicker('getDate');
//设置当前日期
$('#datePicker').datepicker('setDate', '+1m +1d')
})
</script>