以下に示すように: コードをコピーしますコードは次のとおりです: < ;!-- 次のコードを HTML の --> の間に追加します。 <br>function setcountdown(theyear,themonth,theday){<br>yr=theyear;mo=themonth;da=theday<br>}<br>setcountdown(2008, 7,12)<br>varoccasion="2008 年北京オリンピック"<br>var message_on_occasion="待ちに待った瞬間がついにやって来ました!"<br>var countdownwidth='480px'<br>var countdownheight='20px' <br>var countdownbgcolor='tan'<br>var opentags='<font face="宋体"><small>'<br>var closetags='</small></font>'<br>var montharray=new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月" ","Dec")<br>varcrosscount=''<br>function start_countdown(){<br>if (document.layers)<br>document.countdownnsmain.visibility="show"<br>else if (document .all||document.getElementById)<br>crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie<br>countdown()<br>}</p> <p>if (document.all||document.getElementById)<br>document.write('<span id="countdownie" style="width:' countdownwidth '; background-color:' countdownbgcolor '">< ;/span>')</P> <P>window.onload=start_countdown</P> <P><BR>function countdown(){<BR>var today=new Date()<BR>var todayy=today.getyear()<BR>if (todayy <1000)<BR>todayy =1900<BR>var todaym=today.getMonth()<BR>var todayd=today.getDate()<BR>var todayh=today.getHours()<BR>var todaymin=today.getMinutes()<BR>var todaysec=today。 getSeconds()<BR>var todaystring=montharray[todaym] " " todayd ", " todayy " " todayh ":" todaymin ":" todaysec<BR>futurestring=montharray[mo-1] " " da ", " yr<BR>dd=Date.parse(futurestring)-Date.parse(todaystring)<BR>dday=Math.floor(dd/(60*60*1000*24)*1)<BR>dhour=Math.floor(( dd%(60*60*1000*24))/(60*60*1000)*1)<BR>dmin=Math.floor(((dd%(60*60*1000*24))%(60* 60*1000))/(60*1000)*1)<BR>dsec=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))%(60 * 1000))/1000*1)<BR>if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){<BR>if (document.layers){<BR>document.countdownnsmain.document . countdownnssub.document.write(opentags message_on_occasion closetags)<BR>document.countdownnsmain.document.countdownnssub.document.close()<BR>}<BR>else if (document.all||document.getElementById)<BR>crosscount 。 innerHTML=opentags message_on_occasion closetags<BR>return<BR>}<BR>else if (dday<=-1){<BR>if (document.layers){<BR>document.countdownnsmain.document.countdownnssub.document. (opentags "時間が経過しました!" closetags)<BR>document.countdownnsmain.document.countdownnssub.document.close()<BR>}<BR>else if (document.all||document.getElementById)<BR> クロスカウント。 innerHTML=opentags "機会はすでに通過しました! " closetags<BR>return<BR>}<BR>else{<BR>if (document.layers){<BR>document.countdownnsmain.document.countdownnssub.document.write( opentags dday 「 日」、「 dhour 」時間、「 dmin 」分、および「 イベント」まで残り「 dsec」秒 closetags)<BR>document.countdownnsmain.document.countdownnssub.document.close()<BR>}<BR>else if ( document.all||document.getElementById)<BR>crosscount.innerHTML=opentags "および " dday " 日、" dhour " 時間、" dmin " 分、" dsec " 秒は " 機会 closetags<BR>}<BR>setTimeout ("countdown()",1000)<BR>}<BR>< SCRIPT language="JavaScript"><-- BaiduWriteAD("zouwenyedg","3");//--> height="&{countdownheight};" width="&{countdownwidth};"> ;レイヤーid=countdownnssub height="&{countdownheight};" width="&{countdownwidth};" top="0" left="0">