Jquery Easyui日历组件Calender使用详解(23)
更新时间:2016年12月18日 15:02:39 作者:Jsakura
这篇文章主要为大家详细介绍了Jquery Easyui日历组件Calender的使用方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
GPT4.0+Midjourney绘画+国内大模型 会员永久免费使用!
【 如果你想靠AI翻身,你先需要一个靠谱的工具! 】
本文实例为大家分享了Jquery Easyui日历组件的实现代码,供大家参考,具体内容如下
加载方式
Class加载
<div id="box" class="easyui-calendar" style="width:200px;height:200px;"></div>
JS调用加载
1 2 3 4 5 6 7 8 | < div id = "box" ></ div > < script > $(function () { //JS 加载调用 $('#box').calendar({ }); }); </ script > |
属性列表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <script> $( function () { //JS 加载调用 $( '#box' ).calendar({ width : 200, height : 200, fit : false , border : false , firstDay : 0, weeks : [ 'S' , 'M' , 'T' , 'W' , 'T' , 'F' , 'S' ], months : [ 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' ], year : 2016, month : 6, current : new Date(2016,12,17), }); }); </script> |
事件列表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <script> $( function () { //JS 加载调用 $( '#box' ).calendar({ width : 200, height : 200, onSelect : function (date) { alert(date.getFullYear() + ":" + (date.getMonth() + 1) + ":" + date.getDate()); }, onChange : function (newDate, oldDate) { alert(newDate + '|' + oldDate); }, }); }); </script> |
方法列表
1 2 3 4 5 6 7 | //返回属性对象 console.log($( '#box' ).calendar( 'options' )); //调整日历大小 $( '#box' ).calendar( 'resize' ); //移动到指定日期 $( '#box' ).calendar( 'moveTo' , new Date(2015,1,1)); //可以使用$.fn.calendar.defaults 重写默认值对象。 |
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
![](http://files.jb51.net/skin/2018/images/jb51ewm.png)
微信公众号搜索 “ 脚本之家 ” ,选择关注
程序猿的那些事、送书等活动等着你
相关文章
jQuery中bind,live,delegate与one方法的用法及区别解析
本篇文章主要是对jQuery中bind,live,delegate与one方法的用法及区别进行了详细的介绍,需要的朋友可以过来参考下,希望对大家有所帮助2013-12-12
最新评论