求 HTML 万年历代码

求 HTML 万年历代码,第1张

<html>

<head>

   <link rel="stylesheet" type="text/css" href="Skin.css">

   <style>

    <!--

    table{ text-align: center }

    -->

   </style>

</head>

<body>

   <div align="center">

    <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 ("<b>" + my.getFullYear() + "-" + (my.getMonth()+1) + "</b>")

      document.write ("<table border='1' width='273' height='158'>")

      document.write ("<tr>")

      document.write ("<td height='23' width='39'><font color='red'>Sun</font></td>")

      document.write ("<td height='23' width='39'>Mon</td>")

      document.write ("<td height='23' width='39'>Tue</td>")

      document.write ("<td height='23' width='39'>Wed</td>")

      document.write ("<td height='23' width='39'>Thu</td>")

      document.write ("<td height='23' width='39'>Fri</td>")

      document.write ("<td height='23' width='39'>Sat</td>")

      document.write ("</tr>")

      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=0k<6k++) {

       document.write ("<tr>")

       for(j=0j<=6j++) {

        document.write ("<td height='23' width='39'>")

        if(j>=(tempday)) {

         tempday=0//设置为最小,相当于取消判断条件

         if(theday<=max) {

          document.write ("<a title=" + my.getFullYear() + "-" + (my.getMonth()+1) + "-" +theday + " target='_blank' href=detail.asp?date=" + theday + ">")

          if(theday==my.getDate()) 

           document.write ("<font color='green'>[" + theday + "]</font></a>")

           else if(j==0)

           document.write ("<font color='red'>" + theday + "</font></a>")

          else

           document.write (theday + "</a>")

          theday++

         }

        }

        document.write ("</td>")

       }

       document.write ("</tr>")

      }

      document.write ("</table>")

     }

    

     //************************************************函数结束

     showc()

    </script>

   </div>

<body>

</html>

这个是万年历代码

望采纳!

参考资料http://zhidao.baidu.com/question/347251775.html

万年历代码:

<iframe

src="http://freefilehosting.net/file/?id=pdnxl6re"

width="509"

height=433

marginwidth="0"

marginheight="0"

hspace="0"

vspace="0"

frameborder="0"

scrolling="no"></iframe>

老黄历的源代码:

<IFRAME

style="BORDER-RIGHT:

#000000

1px

dotted

BORDER-TOP:

#000000

1px

dotted

BORDER-LEFT:

#000000

1px

dotted

BORDER-BOTTOM:

#000000

1px

dotted"

border=0

name=nongli

marginHeight=0

src="http://www.nongli.com/todaylhl.htm"

frameBorder=no

width=149

scrolling=no

height=140></IFRAME>

最新日历代码(包括日历、星期、现在时间)

<IFRAME

border=0

name=www1.xise.cn

align=center

marginWidth=0

marginHeight=0

src="http://www1.xise.cn/rili/sj.htm"

frameBorder=0

width=146

scrolling=no

height=183></IFRAME>

代码一:<IFRAME

style="BORDER-RIGHT:

#000000

1px

dotted

BORDER-TOP:

#000000

1px

dotted

BORDER-LEFT:

#000000

1px

dotted

BORDER-BOTTOM:

#000000

1px

dotted"

border=0

name=nongli

marginHeight=0

src="http://www.nongli.com/todaylhl.htm"

frameBorder=no

width=149

scrolling=no

height=140></IFRAME>

代码二:<iframe

name="jiro23"

src="http://astro.sina.com.cn/calendar1.htm"

width="500"

height="500"></iframe>

代码三:<iframe

scrolling=no

height=170

width=165

frameborder=0

marginHeight=0

marginWidth=0

src=http://home.id666.com/user/420009598/disk/webdisk/55.html></iframe>

具体步骤是:复制代码---管理博客-----新增空白面板-----钩选显示源代码(出现钩号,同时文档里出现DIV的字样)----粘贴代码----钩选显示源代码(钩号消失)-----保存新增面板----定制个人首页----选取新增个人面板----保存设置


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7307410.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-04
下一篇 2023-04-04

发表评论

登录后才能评论

评论列表(0条)

保存