One, to achieve the function:
1. Click on the arrow above, switch to the first one months, or the next one months, and is linked.
2. As long as it is not the actual month, then the date displayed is gray bottom.
Second, analysis:
1. When we click on the arrow to switch the date, change the top blue year and date.
2. When we click on the switch date arrow, the following TD date and the month shown above correspond.
3. With a judge, whether the actual month, to control the background color of TD, whether it is gray
Demo download
Click Update one months ago $ (". Pre"). Live ("Click", Function () {nowtitledatem--; if (Nowtitledatem = =) {nowlastm = nowTitleDateM-1 nexttitledatey--Nexttitledatem = nowtitledate
M+1 nextlastm = 1}else if (Nowtitledatem = = 0) {nowtitledatey--= 12;
Nowlastm = nowTitleDateM-1;
Nexttitledatem = 1;
Nextlastm = nexttitledatem+1}else if (Nowtitledatem = = 1) {nowlastm = 12;
Nexttitledatem = nowtitledatem+1 nextlastm = nexttitledatem+1}else{nowlastm = nowTitleDateM-1
Nexttitledatem = nowtitledatem+1 nextlastm = nexttitledatem+1}//days and Storage location update ();
Insert to the number of the TD among the INSERTTD ();
Update Date title updatetitle ();
//Click Next one months $ (". Next"). Live ("Click", Function () {nowtitledatem++; if (Nowtitledatem = =) {nowlastm = nowTitleDateM-1 nexttitledatey++ Nexttitledatem = 1 nextlastm
= Nexttitledatem+1 }else if (Nowtitledatem = =) {nowlastm = nowTitleDateM-1 Nexttitledatem = nowtitledatem+1 nextlastm =
1}else if (Nowtitledatem = =) {nowtitledatey++ Nowtitledatem = 1;
Nowlastm = 12;
Nexttitledatem = nowtitledatem+1;
Nextlastm = nexttitledatem+1}else if (Nowtitledatem = = 1) {nowlastm = 12; Nexttitledatem = nowtitledatem+1 nextlastm = nexttitledatem+1}else{nowlastm = nowTitleDateM-1 Nextti
Tledatem = nowtitledatem+1 nextlastm = nexttitledatem+1}//days and Storage location update ();
Insert to the number of the TD among the INSERTTD ();
Update Date title updatetitle (); })
The above is the entire content of this article, I hope to help you, thank you for the support of the cloud habitat community!