本文实例讲述了jQuery简单实现日历的方法。分享给大家供大家参考。具体分析如下:
原理挺简单的,首先算出一个月有多少天,再算出这个月的第一天是星期几,接着顺序排下来就可以了.
tryMyOwnCalendar *{ margin:0; padding:0;} .choosecal{ width:96%; margin:3% auto; overflow:hidden;} .ccaltop{ width:100%; border-radius:5px; } .caltline1,.caltline2{ width:94%; background-color:#F90; overflow:hidden; padding:2% 3%;} .caltline1 p,.caltline2 p{ float:left; width:10%; font-weight:700; text-align:right;} .caltline1 .bookdate{ width:90%; text-align:left;} .caltline2{ background-color:#FFF; display:none;} .caltline2 p{ width:20%;} .caltline2 .datetext{ width:35%; border:1px solid #000; background-color:#FFF; font-weight:700;} .inputdate{ color:#F60;} .calender{ width:100%; margin-top:3%; overflow:hidden; display:none;} .selectmouth{ background-color:#F30; width:94%; overflow:hidden;padding:2% 3%;border-radius:5px 5px 0 0;} .selectmouth p{ float:left; width:33%; color:#FFF; font-weight:700; cursor:pointer;} .selectmouth .selectdate{ width:100%; background-color:#F30; border:none; color:#FFF; font-weight:700; text-align:center;} .data_table{ width:100%;border:1px solid #cccccc; border-collapse:collapse; } .data_table thead{ background-color:#333;} .data_table thead td{ color:#FFF; text-align:center; border:1px solid #333;border-collapse:collapse; padding:1% 0; } .data_table tbody td{border:1px solid #cccccc; border-collapse:collapse; text-align:center;color:#0C6;padding:1% 0; } .data_table tbody td.orderdate{ color:#000;} .data_table tbody td.tdselect{ color:#fff;background-color:#999} 选择入住日期……
至
<
>
日 一 二 三 四 五 六 1 1 1 1 1 1
希望本文所述对大家的jQuery程序设计有所帮助。



