我想在网站主页上添加一个万年历。谁能帮我改代码?
//CLD。SY.selectedIndex = yangy//-1900;
//push TM(‘YU‘);
//push TM(‘YD‘‘);
CLD。SM.selectedIndex = yangm
push TM(“MD“);
push TM(“MU“);
}
//changeLong end
函数change CLD(){
var y,m;
y=CLD。sy . selectedindex+1900;
m=CLD。SM.selectedIndex
draw CLD(y,m);
}
函数push TM(K ){
开关(K ){
案例“于”:
如果(CLD。SY.selectedIndex & gtCLD。sy . selectedindex-;
打破;
案例“YD”:
如果(CLD。SY.selectedIndex & ltCLD 149)。sy . selectedindex++;
打破;
案例“MU”:
如果(CLD。SM.selectedIndex & gt0) {
CLD。sm . selectedindex-;
}
否则{
CLD。sm . selectedindex = 11;
如果(CLD。SY.selectedIndex & gtCLD。sy . selectedindex-;
}
打破;
案例“MD”:
如果(CLD。SM.selectedIndex & lt11) {
CLD。sm . selectedindex++;
}
否则{
CLD。sm . selectedindex = 0;
如果(CLD。SY.selectedIndex & ltCLD 149)。sy . selectedindex++;
}
打破;
默认值:
CLD。sy . selectedindex = tY-1900;
CLD。SM.selectedIndex = tM
}
change CLD();
}
var Today = new Date();
var tY = today . get full year();
var tM = today . getmonth();
var tD = today . getdate();
//////////////////////////////////////////////////////////////////////////////
var width =“130“;
var offsetx = 2;
var offsety = 16;
var x = 0;
var y = 0;
var snow = 0;
var SW = 0;
var CNT = 0;
var dStyle
document.onmousemove = mEvn
//显示详细的日期信息
函数mOvr(v ){
var s,节日;
var sObj = eval(‘SD’‘+v);
var d = sobj . innerhtml-1;
//年,月,日,周,
//年,月,日,月,
//cYear,cMonth,cDay
if(sobj . innerhtml!='''') {
sobj . style . cursor =“s-调整大小“;
if(CLD【d】。solarTerms = =““““& amp;& ampCLD【d】solarFestival = =““““& amp;& ampCLD【d】lunar festival = =‘‘‘‘)
festival =““““;
其他
festival =““& lt;表格宽度=100% BORDER=0单元格填充=4单元格间距= 0 BGCOLOR =“# 333333“& gt;& ltTR & gt& ltTD ALIGN =“RIGHT“& gt。''+
‘‘& lt;FONT style =“color:# FFFFFF;font-size:9pt“& gt。‘‘+CLD【d】。solarTerms+““““+CLD【d】。solarFestival+““““+CLD【d】。lunar festival+““& lt;/FONT & gt;& lt/TD & gt;''+
‘‘& lt;/TR & gt;& lt/TABLE & gt;'';
s =‘‘‘& lt;TABLE WIDTH =“140“BORDER = 0 cell padding =“0“CELLSPACING = 0 BGCOLOR =“# 000099“& gt;& ltTR & gt& ltTD & gt'' +
‘‘& lt;表格宽度=100% BORDER=0单元格填充=4单元格间距= 0 & gt& ltTR & gt& ltTD ALIGN =“RIGHT“nowrap & gt。& ltFONT style =“color:# FFFFFF;font-size:9pt“& gt。''+
CLD【d】sYear+“year“+CLD【d】。s month+‘月“+CLD【d】。sDay+‘day周““+CLD【d】。周+‘‘《br & gt;‘+
‘‘& lt;font color =“fuchsia“& gt。农历“+”(CLD【d】。islap?leap“”“““)+CLD【d】。lMonth+‘月‘‘+CLD【d】。lDay+‘‘日& ltbr & gt''+
‘‘& lt;font color =“yellow“& gt。+CLD【d】。cyyear+“year“+CLD【d】。cMonth+“月“+CLD【d】。cDay+‘day《/font & gt;‘+
‘‘& lt;/FONT & gt;& lt/TD & gt;& lt/TR & gt;& lt/TABLE & gt;‘+festival+‘‘& lt;/TD & gt;& lt/TR & gt;& lt/TABLE & gt;'';
document . all【“detail“】。innerHTML = s;
if(snow = = 0 ){
d style . left = x+offsetx-(width/2);
d style . top = y+offsety;
d style . visibility =“visible“;
snow = 1;
}
}
}
//清除详细日期数据
函数mOut(){
if(CNT & gt;= 1){ SW = 0 }
if(SW = = 0)
{ snow = 0;
d style . visibility =“hidden“;}
else cnt++;
}
//获取位置
函数mEvn(){
x = event.x
y = event.y
if(document . body . scroll left)
{ x = event . x+document . body . scroll left;y = event . y+document . body . scroll top;}
如果(雪)
dStyle.left = x+offsetx-(宽度/2)
d style . top = y+offset
}
}
///////////////////////////////////////////////////////////////////////////
函数tick(){
今日风险值
今天=新日期()
时钟。innerhtml =今天。tolocalstring()。替换(/(年|月)/g,“/”)。替换(/ day/,““);
//clock . innerhtml = time add(today . togmtstring(),CLD。TZ.value)
window . settimeout(“tick()“,1000);
}
函数setCookie(名称,值){
var today =新日期()
var过期=新日期()
expires . settime(today . gettime()+1000 * 60 * 60 * 24 * 365)
document . cookie = name+“=“+escape(value)+“;expires =“+expires . togmtstring()
}
函数get cookie(Name ){
var search = Name+“=“
if(document . cookie . length & gt;0) {
offset = document . cookie . index of(search)
if(offset!= -1) {
偏移量+= search.length
end = document . cookie . index of(“;“偏移)
if(end = =-1)end = document . cookie . length
返回unescape(document . cookie . substring(offset,end))
}
否则返回““
}
}
/////////////////////////////////////////////////////////
函数initial(){
dStyle = detail.style
CLD。sy . selectedindex = tY-1900;
CLD。SM.selectedIndex = tM
draw CLD(tY,tM);
// CLD。tz . selectedindex = get cookie(“TZ“);
//changeTZ();
tick();
}
//--& gt;
& lt/SCRIPT & gt;
& ltSTYLE & gt。todyaColor {
背景色:#99ff00
}
& lt/STYLE & gt;
& ltMETA content =“MSHTML 6 . 00 . 2800 . 1106“name = GENERATOR & gt。& lt/HEAD & gt;
& ltBODY oncontext menu = self . event . return value = false background =“/root/mnt/52005325163735 . gif“
left margin = 0 top margin = 0 onload = initial()& gt;
& lt表格高度=“100%“单元格间距=0单元格填充=0宽度=“100%“对齐=居中
border = 0 & gt
& lt表单名称= CLD & gt;
& ltTBODY & gt
& ltTR & gt
& ltTD valign=middle align=center>。
& lt脚本语言= JavaScript & gt
& lt/SCRIPT & gt;
& ltDIV id =详细信息
style =“LEFT:330 px;宽度:140 px;位置:绝对;TOP:199 px;高度:16px“》;& lt/DIV & gt;
& lt表格单元格间距=1单元格填充= 1 align = center bgColor = # 000000
border = 0 & gt& ltTBODY & gt
& ltTR bgColor=#ffffff>。
& ltTD vAlign=top width=220>。
& lt表格高度=“100%“单元格间距=0单元格填充=4宽度=“100%“
align = center border = 0 & gt
& ltTBODY & gt
& ltTR height = 28 & gt
& ltTD align = center bgColor = # 333333 & gt。& lt字体
color = white & gt日历查询
& ltTR height = * & gt
& ltTD align=center>。& ltFONT id=tSave
style =“FONT-SIZE:18pt;颜色:红色;FONT-FAMILY: Wingdings“》。& lt/FONT & gt;公历:
& ltSELECT class = input 1 onchange = change CLD()name = SY & gt;
& lt脚本语言= JavaScript & gt
& lt!-
for(I = 1900;我& lt2050;i++)document . write(‘‘& lt;选项& gt‘+I)
//--& gt;
& lt/SCRIPT & gt;
& lt/SELECT & gt;年份《SELECT class = input 1 onchange = change CLD()name = SM & gt;
& lt脚本语言= JavaScript & gt
& lt!-
for(I = 1;我& lt13;i++)document . write(‘‘& lt;选项& gt‘+I)
//--& gt;
& lt/SCRIPT & gt;
& lt/SELECT & gt;月份《BR & gt& ltBR & gt农历:
onchange = changeLong()name = d 1 & gt;
& lt脚本语言= JavaScript & gt
& lt!-
for(I = 1900;我& lt2050;i++)document . write(‘‘& lt;选项& gt‘+I)
//--& gt;
& lt/SCRIPT & gt;
& lt/SELECT & gt;年份《SELECT class = input 1 onchange = changeLong()name = D2 & gt;
& lt脚本语言= JavaScript & gt
& lt!-
for(I = 1;我& lt13;i++)document . write(‘‘& lt;选项& gt‘+I)
//--& gt;
& lt/SCRIPT & gt;
& lt/SELECT & gt;月份《BR & gt& ltBR & gt& ltBR & gt& lt/TD & gt;& lt/TR & gt;
& ltTR height = 28 & gt
& ltTD align = center width = 240 bgColor = # dddddd
height = 28 & gt当前时间:
id = Clock & gt& lt/FONT & gt;& lt!-时区*表示自动调整为夏令时-& gt;
& lt/TD & gt;
& lttr height = 28 & gt
& lttd & gt& ltdiv align =“center“& gt;& ltimg src =“/root/mnt/3615244 _ 7441491 . gif“& gt;& lt/div & gt;
& lt/TD & gt;
& lt/tr & gt;& lt/TBODY & gt;& lt/TABLE & gt;& lt/TD & gt;
& ltTD align = center width = 420 height = 255 rowSpan = 3 & gt。
& lt表格高度=28单元格间距=4单元格填充= 0 width =“100%“
bgColor=#333333 border=0>。
& ltdiv align =“center“& gt;& ltimg src =“/root/mnt/0002 . gif“& gt;& lt/div & gt;
& ltTBODY & gt
& ltTR & gt
& ltTD width=5>。& ltFONT title=去年
style =“CURSOR:hand;COLOR:# ffffff“onclick =“push TM(‘YU‘‘)“
face=webdings>。& lt/FONT & gt;& lt/TD & gt;
& ltTD width=5>。& ltFONT title=上月
style =“CURSOR:hand;COLOR:# ffffff“onclick =“push TM(‘MU‘‘)“
face=webdings>。& lt/FONT & gt;& lt/TD & gt;
& ltTD & gt& ltFONT id=YMBG color=#ffffff>。& lt/FONT & gt;& lt/TD & gt;
& ltTD align=right>。& ltGZ color=#ffffff>。& lt/FONT & gt;& lt/TD & gt;
& ltTD align=right width=5>。& ltFONT title=下个月
style =“CURSOR:hand;COLOR:# ffffff“onclick =“push TM(‘MD‘‘)“
face=webdings>。& lt/FONT & gt;& lt/TD & gt;
& ltTD align=right width=5>。& ltFONT title=明年
style =“CURSOR:hand;COLOR:# ffffff“onclick =“push TM(‘YD‘‘)“
face=webdings>。& lt/FONT & gt;& lt/TD & gt;& lt/TR & gt;& lt/TBODY & gt;& lt/TABLE & gt;
& lt表格单元格间距=1单元格填充= 0 width =“100%“bgColor = # ffffff
border = 0 & gt
& ltTBODY & gt
& ltTR align = center bgColor = # dddddd & gt。
& ltTD width=60 height=24>。日《/TD & gt;
& ltTD width=60>。1《/TD & gt;
& ltTD width=60>。第二个《/TD & gt;
& ltTD width=60>。三
& ltTD width=60>。四
& ltTD width=60>。五
& ltTD width=60>。六
& lt脚本语言= JavaScript & gt
& lt!-
gNum变种
for(I = 0;我& lt6;i++) {
document . write(‘‘& lt;tr align=center>。'')
for(j = 0;j & lt7;j++) {
gNum = i*7+j
document . write(‘‘& lt;TD id =“GD““+gNum+““onMouseOver =“mOvr(“+gNum+““)“onMouseOut =“mOut()“nowrap & gt。& ltfont id =“SD““+gNum+““size = 2 face =“Arial Black“““)
if(j = = 0)document . write(‘color = red‘‘)
如果(j == 6)
if(I % 2 = = 1)document . write(“color = red“)
else document . write(‘color = green‘)
document . write(‘TITLE =““& gt;& lt/font & gt;& ltbr & gt& ltfont id =“LD“+gNum+““style =“font-size:9pt“& gt。& lt/font & gt;& lt/TD & gt;'')
}
document . write(‘‘& lt;/tr & gt;'')
}
//--& gt;
& lt/SCRIPT & gt;
& ltTR & gt
& ltTD & gt& lt/TD & gt;& lt/TR & gt;& lt/TBODY & gt;& lt/TABLE & gt;& lt/TD & gt;& lt/TR & gt;& lt/TBODY & gt;& lt/TABLE & gt;
& lt/TD & gt;& lt/TR & gt;& lt/FORM & gt;& lt/TBODY & gt;& lt/TABLE & gt;& lt, ;/BODY & gt;& lt/HTML