日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

软件开发javascript html实现网页版日历代码_javascript技巧

發布時間:2024/8/1 javascript 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 软件开发javascript html实现网页版日历代码_javascript技巧 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

軟件開發javascript html實現網頁版日歷代碼_javascript技巧本文實例為大家分享了網頁版日歷代碼,供大家參考,具體內容如下

效果圖:

實現代碼:

<span style="color:#555555"><span style="background-color:#ffffff"><span style="background-color:#ededed"> </span></span></span> <script language="javascript"> var my = new Date(); function showc() { var k=1; var j=1; var today; var tomonth; var theday=1;//日期 var max; var temp; var tempday;//這個月第一天的星期 document.write ("" + my.getFullYear() + "-" + (my.getMonth()+1) + ""); document.write (""); document.write (""); document.write (""); document.write (""); document.write (""); document.write (""); document.write (""); document.write (""); document.write (""); document.write (""); temp=my.getDate(); my.setDate(1); //document.write (my.getDate()); tempday=my.getDay();//返回第一天是星期幾 my.setDate(temp); today=my.getDay();//返回現在星期幾 switch ((my.getMonth()+1)) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: max=31; break; case 4: case 6:case 9: case 11: max=30; break; default: max=29;//這里沒有考慮閏月!! //document.write (max); } for(k=0;k<6;k++) { document.write (""); for(j=0;j<=6;j++) { document.write (""); } document.write (""); }document.write ("
SunMonTueWedThuFriSat
"); if(j>=(tempday)) { tempday=0;//設置為最小,相當于取消判斷條件 if(theday<=max) { document.write (""); if(theday==my.getDate()) document.write ("[" + theday + "]"); else if(j==0) document.write ("" + theday + ""); else document.write (theday + ""); theday++; } } document.write ("
"); } showc(); </script>

以上就是本文的全部內容,希望大家可以輕松實現網頁版日歷。

總結

以上是生活随笔為你收集整理的软件开发javascript html实现网页版日历代码_javascript技巧的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。