皮皮网
皮皮网

【在线手册系统 源码】【linux ping程序源码】【linux ping内核源码】html 日历源码_html日历源码

时间:2024-12-27 15:55:04 来源:aide编程源码大全

1.求大家帮我发个网页代码。日历日历(制作一个日历)
2.fullcalendar显示当月日历方法
3.请问网页中的源码源码日历怎么做
4.求 网页日历代码

html 日历源码_html日历源码

求大家帮我发个网页代码。(制作一个日历)

       <body onLoad="setCurrentMonth()"><script language="JavaScript">var ie=document.allvar ns6=document.getElementById&&!document.allvar n=document.layersif (ie||ns6) { fShow="visible";fHide="hidden";}if (n) { fShow="show"; fHide="hide";}var MonthNames = new Array("一月",日历日历 "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月");var nCurrentYear = 0;var nCurrentMonth = 0;var nWidth = ;var nHeight = ;var leftX;var rightXvar topY;var bottomY;function Calendar(){ var HTMLstr = "";HTMLstr += "<table width='px' cellspacing='0' cellpadding='0' border='1'>\n";HTMLstr += "<tr><td bgcolor='darkblue'>\n";HTMLstr += "\n";HTMLstr += "<table border='0' cols='3' width='%'>\n";HTMLstr += "<tr>\n";HTMLstr += "<td><b><font color='white'>年份:</font></b></td>\n";HTMLstr += "\n";if (n){ HTMLstr += "<td align='right' width=''>\n"; HTMLstr += "<a href=\"javascript:prevYear();\"><font color='white' size=-2>Prev</font></a>\n"; HTMLstr += "<a href=\"javascript:nextYear();\"><font color='white' size=-2>Next</font></a>\n";}if (ie||ns6){ HTMLstr += "<td align='right' width=''>\n";HTMLstr += "<a href=\"javascript:prevYear();\" style='text-decoration: none;'><font color='white' size=-2>Prev</font></a>\n";HTMLstr += "<a href=\"javascript:nextYear();\" style='text-decoration: none;'><font color='white' size=-2>Next</font></a>\n";}HTMLstr += "</td>\n";HTMLstr += "\n";HTMLstr += "<td align='left'>";if (n) HTMLstr += "<ilayer id='main'><layer id='idYear' top='0' left='0'>\n";if (ie||ns6)HTMLstr += "<div id='main' style='position: relative'>\n";HTMLstr += "<font color='#ffff'><b></b></font>\n";if (n) HTMLstr += "</layer></ilayer>\n";if (ie||ns6)HTMLstr += "</div>\n";HTMLstr += "</td>\n";HTMLstr += "</tr>\n";HTMLstr += "<tr>\n";HTMLstr += "<td><b><font color='white'>月份:</font></b></td>\n";HTMLstr += "\n";HTMLstr += "<td align='right'>\n";if (n){ HTMLstr += "<a href=\"javascript:prevMonth();\"><font color='white' size=-2>Prev</font></a>\n"; HTMLstr += "<a href=\"javascript:nextMonth();\"><font color='white' size=-2>Next</font></a>\n";}if (ie||ns6){ HTMLstr += "<a href=\"javascript:prevMonth();\" style='text-decoration: none;'><font color='white' size=-2>Prev</font></a>\n";HTMLstr += "<a href=\"javascript:nextMonth();\" style='text-decoration: none;'><font color='white' size=-2>Next</font></a>\n";}HTMLstr += "</td>\n";HTMLstr += "\n";HTMLstr += "<td align='left'>\n";if (ie||ns6)HTMLstr += "<div id='main2' style='position=relative;'>";if (n) HTMLstr += "<ilayer id='main2'><layer id='idMonth' top='0' left='0'>\n";HTMLstr += "<font color='#ffff'><b>December</b></font>\n";if (ie||ns6)HTMLstr += "<div>\n";if (n) HTMLstr += "</layer></ilayer>\n";HTMLstr += "</td>\n";HTMLstr += "\n";HTMLstr += "</tr>\n";HTMLstr += "</table>\n";HTMLstr += "\n";HTMLstr += "</td></tr>\n";HTMLstr += "\n";HTMLstr += "<tr height='px'><td valign=\"top\">\n";HTMLstr += "\n";HTMLstr += "<table border=0 cols=7>\n";HTMLstr += "<tr>\n";HTMLstr += "<td width=''><b>Mon</b></td>\n";HTMLstr += "<td width=''><b>Tue</b></td>\n";HTMLstr += "<td width=''><b>Wed</b></td>\n";HTMLstr += "<td width=''><b>Thur</b></td>\n";HTMLstr += "<td width=''><b>Fri</b></td>\n";HTMLstr += "<td width=''><b>Sat</b></td>\n";HTMLstr += "<td width=''><b>Sun</b></td>\n";HTMLstr += "</tr>\n";HTMLstr += "<tr>\n";HTMLstr += "<td colspan=7>\n";if (ie||ns6)HTMLstr += "<div style='position: relative;'>";if (n) HTMLstr += "<ilayer id='idMenuContainer' height='px' width='px'>\n"; for (var date=1; date <= ; date++) { if (n){ HTMLstr += " <layer id=\"idDate"+date+"\" val="+date+" visibility=\"hide\">\n"; HTMLstr += " <layer><b>"+date+"</b></layer>\n"; HTMLstr += " </layer>\n";}if (ie||ns6){ HTMLstr += " <div id=\"idDate"+date+"\" val="+date+" style=\"position: absolute; visibility: hidden\">\n"; // HTMLstr += " <b>"+date+"</b>\n"; HTMLstr += " <b>"+date+"</b>\n"; HTMLstr += " </div>\n";} }if (ie||ns6)HTMLstr += "</div>";if (n) HTMLstr += "</ilayer>\n";HTMLstr += "</td></tr>\n";HTMLstr += "</table>\n";HTMLstr += "\n";HTMLstr += "</td></tr>\n";HTMLstr += "</table>\n";document.writeln(HTMLstr);buildMonthMenu(HTMLstr);}function setCurrentMonth(){ date = new Date(); currentyear=date.getYear() if (currentyear < ) currentyear+= setYearMonth(currentyear, date.getMonth()+1);}function setMonth(nMonth){ setYearMonth(nCurrentYear, nMonth);}function setYearMonth(nYear, nMonth){ if (ie||ns6){ nCurrentYear = nYear; nCurrentMonth = nMonth; var cross_obj=ns6? document.getElementById("main"): document.all["main"] var cross_obj2=ns6? document.getElementById("main2"): document.all["main2"] cross_obj.innerHTML = "<font color=\"#ffff\"><b>"+nCurrentYear+"</b></font>"; cross_obj2.innerHTML = "<a href=\"javascript:showMonthMenu()\" style=\"text-decoration:none\"><font color=\"#ffff\"><b>"+MonthNames[nCurrentMonth-1]+"</b></font></a>\n"; var date = new Date(nCurrentYear, nCurrentMonth-1, 1); var nWeek = 1; var nDate; while (date.getMonth() == nCurrentMonth-1) { nDate = date.getDate(); nLastDate = nDate; var posDay = date.getDay()-1; if (posDay == -1) posDay=6; var posLeft = posDay*(nWidth+5)+5; var posTop = (nWeek-1)*nHeight; var cross_obj3=ns6? document.getElementById("idDate"+nDate).style : document.all["idDate"+nDate].style cross_obj3.left = posLeft; cross_obj3.top = posTop; if (date.getDay() == 0 || date.getDay() == 6) cross_obj3.color = "red"; else cross_obj3.color = "black"; cross_obj3.visibility = "visible"; // original: // date = new Date(currentyear, date.getMonth(), date.getDate()+1); // johan: date = new Date(nCurrentYear, date.getMonth(), date.getDate()+1); if (posDay == 6) nWeek++; } for (++nDate; nDate <= ; nDate++){ cross_obj3=ns6? document.getElementById("idDate"+nDate).style : document.all["idDate"+nDate].style cross_obj3.visibility = "hidden"; }} if (n){ // Verify parameters if (nMonth < 1 || nMonth > ) { alert("Function: setYearMonth()\nERROR: Incorrect month "+nMomth);} nCurrentYear = nYear; nCurrentMonth = nMonth; document.main.document.idYear.document.open(); document.main.document.idYear.document.write("<font color=\"#ffff\"><b>"+nCurrentYear+"</b></font>"); document.main.document.idYear.document.close(); document.main2.document.idMonth.document.open(); document.main2.document.idMonth.document.write("<a href=\"javascript:showMonthMenu()\" style=\"text-decoration:none\"><font color=\"#ffff\"><b>"+MonthNames[nCurrentMonth-1]+"</b></font></a>"); document.main2.document.idMonth.document.close(); var date = new Date(nYear, nMonth-1, 1); var nWeek = 1; var nDate; while (date.getMonth() == nMonth-1) { nDate = date.getDate(); nLastDate = nDate; var posDay = date.getDay()-1; if (posDay == -1) posDay=6; var posLeft = posDay*(nWidth+5)+5; var posTop = (nWeek-1)*nHeight; document.layers["idMenuContainer"].document.layers["idDate"+nDate].left = posLeft; document.layers["idMenuContainer"].document.layers["idDate"+nDate].top = posTop; if (date.getDay() == 0 || date.getDay() == 6) document.layers["idMenuContainer"].document.layers["idDate"+nDate].color = "red"; else document.layers["idMenuContainer"].document.layers["idDate"+nDate].color = "black"; document.layers["idMenuContainer"].document.layers["idDate"+nDate].visibility = "visible"; date = new Date(nCurrentYear, date.getMonth(), date.getDate()+1); if (posDay == 6) nWeek++; } for (++nDate; nDate <= ; nDate++) document.layers["idMenuContainer"].document.layers["idDate"+nDate].visibility = "hidden";}}function nextMonth(){ nCurrentMonth++; if (nCurrentMonth > ) { nCurrentMonth -= ; nextYear(); } setYearMonth(nCurrentYear, nCurrentMonth);}function prevMonth(){ nCurrentMonth--; if (nCurrentMonth < 1) { nCurrentMonth += ; prevYear(); } setYearMonth(nCurrentYear, nCurrentMonth);}function prevYear(){ nCurrentYear--; setYearMonth(nCurrentYear, nCurrentMonth);}function nextYear(){ nCurrentYear++; setYearMonth(nCurrentYear, nCurrentMonth);}////////////////////////////////////////////////////function updateIt(e){ // var x = e.pageX;// var y = e.pageY;// if (x > rightX || x < leftX) hideMonthMenu();// else if (y > bottomY || y < topY) hideMonthMenu();}function hideMonthMenu(){ document.layers["idMonthMenu"].visibility="hide";}function showMonthMenu(){ if (!n) return; topY = document.layers["main2"].pageY-; bottomY = document.layers["main2"].pageY + document.layers["idMonthMenu"].clip.height+; leftX = document.layers["main2"].pageX-; rightX = document.layers["main2"].pageX + document.layers["idMonthMenu"].clip.width+; document.layers["idMonthMenu"].top = document.layers["main2"].pageY+document.layers["main2"].clip.height; document.layers["idMonthMenu"].left = document.layers["main2"].pageX; document.layers["idMonthMenu"].visibility="show";}function buildMonthMenu(){ if (!n) return; var HTML = ""; HTML += "<layer id=\"idMonthMenu\" visibility=\"hide\" width=\"\" bgcolor=\"darkblue\">\n"; HTML += "<table border=\"1\" cellspacing=\"0\" cellpading=\"0\">\n"; for (var month=0; month<;) { HTML += "<tr>\n"; for (var i = 0; i < 3; i++) { var nMonth = month+1; HTML += "<td><a href=\"javascript:hideMonthMenu();setMonth("+nMonth+");\"><font color=\"white\" size=-1><b>"+MonthNames[month]+"</b></font></a></td>\n"; month++; } HTML += "</tr>\n"; } HTML += "</table>"; HTML += "</layer>"; document.writeln(HTML);}var cal = new Calendar();</script>

       注:将以上代码加入到网页中的<body></body>区中即可、不必修改

fullcalendar显示当月日历方法

       切图网专注于前端开发,源码源码在线手册系统 源码包括fullcalendar日历改造,日历日历最近项目就遇到了,源码源码linux ping程序源码项目中日期插件用的日历日历是fullcalendar,需要显示农历、源码源码阴历、日历日历节气、源码源码当前是日历日历第几周、星期几、源码源码天干地支、日历日历linux ping内核源码生肖年等等,源码源码实现的日历日历demo效果如下:

       由于插件本身不支持使用农历、节日展示所以对fullcalendar进行了修改,粒子头像源码下载当你重新安装是需要手动去修改源码,修改内容如下

       * 1、在fullcalendar.js之前引入lunar.js

       lunar.js是一个计算农历和各种节假日的第三方js,需在fullcalendar前引用。matlab fft c源码

       * 2、修改fullcalendar.js

       正常生成的日历只是包含一个日期,想要显示农历就需要手动修改源码,目前我使用的版本是3.9.0,改动仅有一处。

       if (isDayNumberVisible) { html += view.buildGotoAnchorHtml(date, , date.format(D) // inner HTML);//此处可以搜索fc-day-number,在下面添加以下代码var cTerm = lunar(date).term;if(cTerm){ html+=div class=fc-day-cnTerm+cTerm+/div;}var fes = lunar(date).festival();if(fesfes.length0){ html += div class=fc-day-cnTerm + $.trim(fes

       .desc)+/div;}if(!cTerm (!fes || fes.length == 0)){ html += div class=fc-day-cnDate+lunar(date).lMonth+月+lunar(date).lDate+/div;}

       结语

       至此就都改完了,剩下就是样式了,随便你怎么调可以自由发挥。

       来源:t = 0;

       var dStyle;

       document.onmousemove = mEvn;

       //显示详细日期资料

       function mOvr(v) {

        var s,festival;

        var sObj=eval('SD'+ v);

        var d=sObj.innerHTML-1;

        //sYear,sMonth,sDay,week,

        //lYear,lMonth,lDay,isLeap,

        //cYear,cMonth,cDay

        if(sObj.innerHTML!='') {

        sObj.style.cursor = 's-resize';

        if(cld[d].solarTerms == '' && cld[d].solarFestival == '' && cld[d].lunarFestival == '')

        festival = '';

        else

        festival = '<TABLE WIDTH=% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#CCFFCC"><TR><TD>'+

        '<FONT COLOR="#" STYLE="font-size:9pt;">'+cld[d].solarTerms + ' ' + cld[d].solarFestival + ' ' + cld[d].lunarFestival+'</FONT></TD>'+

        '</TR></TABLE>';

        s= '<TABLE WIDTH="" BORDER=0 CELLPADDING="2" CELLSPACING=0 BGCOLOR="#"><TR><TD>' +

        '<TABLE WIDTH=% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN="right"><FONT COLOR="#ffffff" STYLE="font-size:9pt;">'+

        cld[d].sYear+' 年 '+cld[d].sMonth+' 月 '+cld[d].sDay+' 日<br>星期'+cld[d].week+'<br>'+

        '<font color="violet">农历'+(cld[d].isLeap?'闰 ':' ')+cld[d].lMonth+' 月 '+cld[d].lDay+' 日</font><br>'+

        '<font color="yellow">'+cld[d].cYear+'年 '+cld[d].cMonth+'月 '+cld[d].cDay + '日</font>'+

        '</FONT></TD></TR></TABLE>'+ festival +'</TD></TR></TABLE>';

       document.all["detail"].innerHTML = s;

        if (snow == 0) {

        dStyle.left = x+offsetx-(width/2);

        dStyle.top = y+offsety;

        dStyle.visibility = "visible";

        snow = 1;

        }

        }

       }

更多内容请点击【百科】专栏