欢迎来到天天文库
浏览记录
ID:51714476
大小:48.50 KB
页数:13页
时间:2020-03-15
《网页显示时间代码和倒计时代码大全.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、网页显示时间代码和倒计时代码大全:varenabled=0;today=newDate();varday;vardate;if(today.getDay()==0)day="星期日"if(today.getDay()==1)day="星期一"if(today.getDay()==2)day="星期二"if(today.getDay()==3)day="星期三"if(today.getDay()==4)day="星期四"if(today.getDay()==5)day="星期五"if(today.getDay
2、()==6)day="星期六"document.fgColor="cadet";date1=""+(today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日"+"";date2=""+day+"";document.write(""+date1.fontsize(2)+date2.fontsize(2)+"
3、");17:47:26functionwww_helpor_net(){varDigital=newDate()varhours=Digital.getHours()varminutes=Digital.getMinutes()varsecond
4、s=Digital.getSeconds()if(minutes<=9)minutes="0"+minutesif(seconds<=9)seconds="0"+secondsmyclock=""+hours+":"+minutes+":"+seconds+""if(document.layers){document.layers.liveclock.document.write(myclock)document.layers.liveclock.document.close()}elseif(do
5、cument.all)liveclock.innerHTML=myclocksetTimeout("www_helpor_net()",1000)}www_helpor_net();//-->中文显示的时候保存为.js文件再用网页调用出现乱码。用uft-8编码保存.js文件即可解决乱码问题。---------------------------------------------------------分割线-----------------------------------------------------实时游走的数字时钟6、t>functiontick(){varhours,minutes,seconds,xfile;varintHours,intMinutes,intSeconds;vartoday;today=newDate();intHours=today.getHours();intMinutes=today.getMinutes();intSeconds=today.getSeconds();if(intHours==0){hours="12:";xfile="午夜";}elseif(intHours<12){hours=intHours+":";xfile="上午";7、}elseif(intHours==12){hours="12:";xfile="正午";}else{intHours=intHours-12hours=intHours+":";xfile="下午";}if(intMinutes<10){minutes="0"+intMinutes+":";}else{minutes=intMinutes+":";}if(intSeconds<10){seconds="0"+intSeconds+"";}else{seconds=intSeconds+"";}timeString=xfile+hours+minutes+se8、conds;Clock.innerHT
6、t>functiontick(){varhours,minutes,seconds,xfile;varintHours,intMinutes,intSeconds;vartoday;today=newDate();intHours=today.getHours();intMinutes=today.getMinutes();intSeconds=today.getSeconds();if(intHours==0){hours="12:";xfile="午夜";}elseif(intHours<12){hours=intHours+":";xfile="上午";
7、}elseif(intHours==12){hours="12:";xfile="正午";}else{intHours=intHours-12hours=intHours+":";xfile="下午";}if(intMinutes<10){minutes="0"+intMinutes+":";}else{minutes=intMinutes+":";}if(intSeconds<10){seconds="0"+intSeconds+"";}else{seconds=intSeconds+"";}timeString=xfile+hours+minutes+se
8、conds;Clock.innerHT
此文档下载收益归作者所有