您的位置:首页 > 运维架构 > Linux

linux daemon 守护进程

2011-09-19 17:54 295 查看
更详细介绍官网:http://jqueryui.com/demos/datepicker/

第一次使用jquery的datepicker时,找了很久才找到怎么设置中文,今天重新学习了一下,原来jquery已经自带好了,在jquery根目录/development-bundle/ui/i18n/每个国家相对于的语言js文件,简体中文的为jquery.ui.datepicker-zh-CN.js。

<link href="jquery/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="jquery/js/jquery-1.6.2.min.js"></script>

<script type="text/javascript" src="jquery/js/jquery-ui-1.8.16.custom.min.js"></script>

<script type="text/javascript" src="jquery/jquery.ui.datepicker.js"></script>

<script type="text/javascript" src="jquery/jquery.ui.datepicker-zh-CN.js"></script>//包含它后就会显示中文

<script>

$(function(){

$("#datapicker").datepicker({

disabled:false,

altField:'#alt',//与改日期相关联的日期

altFormat:'y-m-d',//相关联日期的格式

appendText:'(yyyy-mm-dd)',//

autoSize:true,

changeMonth:true,

changeYear:true,

dateFormat:'yy/mm/dd',//初始化时的日期格式

duration: 'fast',//这个日期插件显示的速度{'slow','normal','fast'}

showButtonPanel: true ,//增加‘今天’、‘关闭’按钮在底部

showOn: 'button',//展示方式,‘focus’,‘button’,'both',默认为focus

});

})

</script>

</head>

<body style="font-size:62.5%;">

<input type="text" id="datapicker">

<input type="text" id="alt">

</body>

获取datepicker的任意option的值:$("#datapicker").datepicker('option','name');//name为option的名字,如'dateFormat';

设置datepicker的某个属性的值:$("#datapicker").datepicker('option','name','value');

功能函数:

1 $.datepicker.setDefaults();//设置所有的datepicker插件的默认属性,当一个页面中有多个datepicker插件时可以通过该函数设置所有插件都有的属性。例如:

$.datepicker.setDefaults(

{ showOn:'both',

buttonText:'日期',

}

$.datepicker.setDefaults($.datepicker.regional['zh']);//设置所有的日期插件显示为中文

2 $.datepicker.formatDate(format,date,settings).设置日期格式
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: