本文實例為大家分享了Jquery Easyui日歷組件的實現代碼,供大家參考,具體內容如下
加載方式
Class加載
<div id="box" class="easyui-calendar" style="width:200px;height:200px;"></div>
JS調用加載
<div id="box"></div> <script> $(function () { //JS 加載調用 $('#box').calendar({ }); });</script>屬性列表

<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>事件列表

<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>方法列表

//返回屬性對象 console.log($('#box').calendar('options'));//調整日歷大小$('#box').calendar('resize'); //移動到指定日期 $('#box').calendar('moveTo', new Date(2015,1,1));//可以使用$.fn.calendar.defaults 重寫默認值對象。以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。
新聞熱點
疑難解答