Indonesia
<HTML> <HEAD> <TITLE>有用的中英文日历网页特效代码-downcodes.com</TITLE> <!--<script Language="javascript" src="PopupCalendar.js" ></script>-- > <skrip> //lebih lanjut dari downcodes.com function PopupCalendar(InstanceName) { ///Global Tag this.instanceName=InstanceName; ///Properti this.separator="-" this.oBtnTodayTitle="Hari ini" this.oBtnCancelTitle="Batalkan" this.weekDaySting=new Array("S","M","T","W","T ","F","S"); this.monthSting=new Array("Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November" ,"Desember"); ini.Lebar=200; this.currDate=Tanggal baru(); this.hari ini=Tanggal baru(); this.startYear=1970; this.endYear=2010; ///Css this.divBorderCss="1px padat #BCD0DE"; this.tableBorderColor="#CCCCCC" ///Metode this.Init=CalendarInit; this.Fill=Isi Kalender; this.Refresh=CalendarRefresh; this.Restore=CalendarRestore; ///HTMLObjek ini.oTaget=null; this.oPreviousCell=null; this.sDIVID=NamaInstance+"oDiv"; this.sTABLEID=NamaInstance+"oTable"; this.sMONTHID=NamaInstance+"oBulan"; this.sYEARID=NamaInstance+"oTahun"; } function CalendarInit() ///Buat panel { var sMonth,sYear sMonth=this.currDate.getMonth(); sYear=ini.tanggal saat ini.getYear(); htmlAll="<div id='"+this.sDIVID+"' style='display:none;position:absolute;width:"+this.Width+";border:"+this.divBorderCss+";padding:2px;background- warna:#FFFFFF'>"; htmlSemua+="<div align='center'>"; /// Bulan htmloMonth="<select id='"+this.sMONTHID+"' onchange=CalendarMonthChange("+this.instanceName+") style='width:50%'>"; for(i=0;i<12;i++) { htmloMonth+="<option value='"+i+"'>"+this.monthSting[i]+"</option>"; } htmloBulan+="</pilih>"; /// Tahun htmloYear="<pilih id='"+ini.sYEARID+"' onchange=CalendarYearChange("+ini.instanceName+") style='width:50%'>"; for(i=this.startYear;i<=this.endYear;i++) { htmloYear+="<option value='"+i+"'>"+i+"</option>"; } htmloTahun+="</select></div>"; /// Hari htmloDayTable="<table id='"+this.sTABLEID+"' width='100%' border=0 cellpadding=0 Cellspacing=1 bgcolor='"+this.tableBorderColor+"'>"; htmloDayTable+="<tbody bgcolor='#ffffff'style='ukuran font:13px'>"; untuk(i=0;i<=6;i++) { if(i==0) htmloDayTable+="<tr bgcolor='#98B8CD'>"; lain htmloDayTable+="<tr>"; for(j=0;j<7;j++) { if(i==0) { htmloDayTable+="<td height='20' align='center' valign='middle' style='cursor:hand'>" ; htmloDayTable+=this.weekDaySting[j]+"</td>" } else { htmloDayTable+="<td height='20' align='center' valign='middle' style='cursor:hand'"; htmloDayTable+=" onmouseover=CalendarCellsMsOver("+ini.instanceName+")"; htmloDayTable+=" onmouseout=CalendarCellsMsOut("+ini.instanceName+")"; htmloDayTable+=" onclick=CalendarCellsClick(ini,"+ini.instanceName+")>"; htmloDayTable+=" </td>" } } htmloDayTable+="</tr>"; } htmloDayTable+="</tbody></table>"; /// Tombol Hari Ini htmloButton="<div align='center' style='padding:3px'>" htmloButton+="<button style='width:40%;border:1px solid #BCD0DE;background-color:#eeeeee ;cursor:hand'" htmloButton+=" onclick=CalendarTodayClick("+this.instanceName+")>"+this.oBtnTodayTitle+"</button> " htmloButton+="<button style='width:40%;border:1px solid # BCD0DE;warna latar:#eeeeee;kursor:tangan'" htmloButton+=" onclick=CalendarCancel("+this.instanceName+")>"+this.oBtnCancelTitle+"</button> " htmloButton+="</div>" // / Semua htmlSemua=htmlSemua+htmloBulan+htmloTahun+htmloDayTable+htmloButton+"</div>"; document.write(htmlSemua); ini.Isi(); } function CalendarFill() /// { var sMonth,sYear,sWeekDay,sToday,oTable,currRow,MaxDay,sDaySn,sIndex,rowIndex,cellIndex,oSelectMonth,oSelectYear sMonth=this.currDate.getMonth(); sYear=ini.tanggal saat ini.getYear(); sWeekDay=(Tanggal baru(Tahun,Bulan,1)).getDay(); sHari ini=ini.currDate.getDate(); oTable=dokumen.semua[ini.sTABLEID]; currRow=oTable.baris[1]; MaxDay=CalendarGetMaxDay(tahun,sbulan); oSelectMonth=document.all[this.sMONTHID] oSelectMonth.selectedIndex=sMonth; oSelectYear=document.all[this.sYEARID] for(i=0;i<oSelectYear.length;i++) { if(parseInt(oSelectYear.options[i].value)==sYear)oSelectYear.selectedIndex=i; } //// for(sDaySn=1,sIndex=sWeekDay;sIndex<=6;sDaySn++,sIndex++) { if(sDaySn==sToday) { currRow.cells[sIndex].innerHTML="<font color=red>< i><b>"+sDaySn+"</b></i></font>"; this.oPreviousCell=currRow.cells[sIndex]; } else { currRow.cells[sIndex].innerHTML=sDaySn; currRow.cells[sIndex].style.color="#666666"; } CalendarCellSetCss(0,currRow.cells[sIndex]); } for(rowIndex=2;rowIndex<=6;rowIndex++) { if(sDaySn>MaxDay)break; currRow=oTable.baris[indeks baris]; for(cellIndex=0;cellIndex<currRow.cells.length;cellIndex++) { if(sDaySn==sToday) { currRow.cells[cellIndex].innerHTML="<font color=red><i><b>"+sDaySn+ "</b></i></font>"; this.oPreviousCell=currRow.cells[cellIndex]; } else { currRow.cells[cellIndex].innerHTML=sDaySn; currRow.cells[cellIndex].style.color="#666666"; } KalenderCellSetCss(0,currRow.cells[cellIndex]); sDaySn++; if(sDaySn>MaxDay)istirahat; } } } function CalendarRestore() /// Hapus Data { var oTable oTable=document.all[this.sTABLEID] for(i=1;i<oTable.rows.length;i++) { for(j=0;j< oTable.rows[i].cells.length;j++) { CalendarCellSetCss(0,oTable.rows[i].cells[j]); oTable.baris[i].sel[j].innerHTML=" "; } } } fungsi CalendarRefresh(tanggal baru) /// { tanggal ini.currDate=tanggal baru; ini.Pulihkan(); ini.Isi(); } fungsi CalendarCellsMsOver(oInstance) /// Sel MouseOver { var myCell myCell=event.srcElement; CalendarCellSetCss(0,oInstance.oPreviousCell); if(sel saya) { CalendarCellSetCss(1,sel saya); oInstance.oPreviousCell=Sel saya; } } fungsi CalendarCellsMsOut(oInstance) ////// Sel MouseOut { var myCell myCell=event.srcElement; KalenderCellSetCss(0,MyCell); } fungsi CalendarCellsClick(oCell,oInstance) { var sDay,sMonth,sYear,newDate sYear=oInstance.currDate.getFullYear(); sMonth=oInstance.currDate.getMonth(); sDay=oInstance.currDate.getDate(); if(oCell.innerText!=" ") { sDay=parseInt(oCell.innerText); if(sDay!=oInstance.currDate.getDate()) { newDate=tanggal baru(sYear,sMonth,sDay); oInstance.Refresh(tanggal baru); } } sDateString=tahun+oInstance.separator+CalendarDblNum(sMonth+1)+oInstance.separator+CalendarDblNum(sDay); ///kembalikan sDateString if(oInstance.oTaget.tagName=="INPUT") { oInstance.oTaget.value=sDateString; } dokumen.semua[oInstance.sDIVID].style.display="tidak ada"; } function CalendarYearChange(oInstance) /// Perubahan Tahun { var sDay,sMonth,sYear,newDate sDay=oInstance.currDate.getDate(); sMonth=oInstance.currDate.getMonth(); sYear=document.all[oInstance.sYEARID].value newDate=Tanggal baru(sYear,sMonth,sDay); oInstance.Refresh(tanggal baru); } function CalendarMonthChange(oInstance) /// Perubahan Bulan { var sDay,sMonth,sYear,newDate sDay=oInstance.currDate.getDate(); sMonth=document.all[oInstance.sMONTHID].value sYear=oInstance.currDate.getYear(); tanggal baru=tanggal baru(tahun,bulan,hari); oInstance.Refresh(tanggal baru); } function CalendarTodayClick(oInstance) /// Tombol "Hari Ini" Ubah { oInstance.Refresh(tanggal baru()); } fungsi getDateString(oInputSrc,oInstance) { if(oInputSrc&&oInstance) { CalendarDiv=document.all[oInstance.sDIVID]; oInstance.oTaget=oInputSrc; CalendarDiv.style.pixelLeft=CalendargetPos(oInputSrc,"Kiri"); CalendarDiv.style.pixelTop=CalendargetPos(oInputSrc,"Top")+oInputSrc.offsetHeight; CalendarDiv.style.display=(CalendarDiv.style.display=="tidak ada")?"":"tidak ada"; } } function CalendarCellSetCss(sMode,oCell) /// Setel Css Sel { // sMode // 0: OnMouserOut 1: OnMouseOver if(sMode) { oCell.style.border="1px solid #5589AA"; oCell.style.backgroundColor="#BCD0DE"; } else { oCell.style.border="1px solid #FFFFFF"; oCell.style.backgroundColor="#FFFFFF"; } } function CalendarGetMaxDay(nowYear,nowMonth) /// Dapatkan MaxDay bulan ini { var nextMonth,nextYear,currDate,nextDate,theMaxDay nextMonth=nowMonth+1; if(Bulan depan>11) { Tahun berikutnya=SekarangTahun+1; Bulan berikutnya=0; } else { Tahun depan=Tahun sekarang; } tanggal sekarang=Tanggal baru(Tahun sekarang,Bulan sekarang,1); Tanggal berikutnya=Tanggal baru(Tahun depan,Bulan depan,1); theMaxDay=(tanggal berikutnya-tanggal saat ini)/(24*60*60*1000); kembalikan MaxDay; } function CalendargetPos(el,ePro) /// Dapatkan Posisi Absolut { var ePos=0; while(el!=null) { ePos+=el["offset"+ePro]; el=el.offsetParent; } mengembalikan ePo; } fungsi KalenderDblNum(angka) { if(angka<10) mengembalikan "0"+angka; jika tidak, kembalikan nomor; } fungsi CalendarCancel(oInstance) ///Batal { CalendarDiv=document.all[oInstance.sDIVID]; CalendarDiv.style.display="tidak ada"; } </skrip> </head> <BODY > <skrip > var oCalendarEn=New PopupCalendar("oCalendarEn"); //初始化控件时,请给出实例名称如:oCalendarEn oCalendarEn.Init(); var oCalendarChs=Kalender Popup baru("oCalendarChs"); //初始化控件时,请给出实例名称:oCalendarChs oCalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六"); oCalendarChs.monthSting=New Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); oCalendarChs.oBtnTodayTitle="今天"; oCalendarChs.oBtnCancelTitle="取消"; oCalendarChs.Init(); </script> <br><br><br><br> <input readonly type="text" name="dd" id="aa" onClick="getDateString(this,oCalendarEn)" value="Versi Bahasa Inggris" > <br><br><br><br> <input readonly type="text" name="dd" id="aa" onClick="getDateString(this,oCalendarChs)" value="中文界面版"> < /BODI> </HTML>