江西省国防科技工业学校9846班

网会阁

当前位置: 本站首页 > HTML网页特效

09各种风格时间显示

时间:2024-10-28 16:18来源:未知 作者:admin 点击:
html head title各种风格时间显示/title style type="text/css" !-- body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px} A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION

<html>

<head>

<title>各种风格时间显示</title>

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }

A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<SCRIPT language=javascript author=luxiaoqing><!--

function initArray(){for(i=0;i<initArray.arguments.length;i++)

this[i]=initArray.arguments[i];}var isnMonths=new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");var isnDays=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");today=new Date();hrs=today.getHours();min=today.getMinutes();sec=today.getSeconds();clckh=""+((hrs>12)?hrs-12:hrs);

clckm=((min<10)?"0":"")+min;clcks=((sec<10)?"0":"")+sec;clck=(hrs>=12)?"下午":"上午";var stnr="";var ns="0123456789";var a="";


//-->


</SCRIPT>

</head>


<body bgcolor="#fef4d9">

<br>

<br>

<center><font color=red face="隶书" size=6>八种风格的时间日期</font></center>

<br>

<br><center>

<table border=5 bordercolor=blue borderlight=green>

<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>

<tr><td align=center><SCRIPT language=javascript><!--

function getFullYear(d){//d is a date object

yr=d.getYear();if(yr<1000)

yr+=1900;return yr;}document.write("<table width=486>");//don't delete this line


/* 每一段代表一种风格,不需要的删除即可*/


document.write("<TR><TD VALIGN=TOP><P>风格一<P></TD><TD VALIGN=TOP>"+isnDays[today.getDay()]

+","+isnMonths[today.getMonth()]+""+today.getDate()+"日,"

+getFullYear(today)+"年<P>");document.write("<TR><TD VALIGN=TOP>风格二<P></TD><TD VALIGN=TOP>"+clckh+":"+clckm

+":"+clcks+""+clck+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格三<P></TD><TD VALIGN=TOP>"

+isnDays[today.getDay()]+","+isnMonths[today.getMonth()]+""

+today.getDate()+"日,"+getFullYear(today)+"年 "+clckh+":"+clckm+":"

+clcks+""+clck+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格四<P></TD><TD VALIGN=TOP>"

+(today.getMonth()+1)+"/"+today.getDate()+"/"

+(getFullYear(today)+"").substring(2,4)+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格五:<P></TD><TD VALIGN=TOP>"+hrs+":"+clckm+":"+clcks+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格六:<P></TD><TD>"+today+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格七<P></TD><TD>"+navigator.appName+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格八:<P></TD><TD VALIGN=TOP>"+navigator.appVersion+"<P></TD></TR>");document.write("</table>"); // don't delete this line

//-->


</SCRIPT></td></tr></table></center>

<br>

<br>

<center>

<textarea name=source rows=12 cols=55 class=yk9>

脚本说明:

第一步:把如下代码加入<head>区域中

<SCRIPT language=javascript author=luxiaoqing><!--

function initArray(){for(i=0;i<initArray.arguments.length;i++)

this[i]=initArray.arguments[i];}var isnMonths=new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");var isnDays=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");today=new Date();hrs=today.getHours();min=today.getMinutes();sec=today.getSeconds();clckh=""+((hrs>12)?hrs-12:hrs);

clckm=((min<10)?"0":"")+min;clcks=((sec<10)?"0":"")+sec;clck=(hrs>=12)?"下午":"上午";var stnr="";var ns="0123456789";var a="";


//-->


</SCRIPT>

第二步:把如下代码加入区域中

<SCRIPT language=javascript><!--

function getFullYear(d){//d is a date object

yr=d.getYear();if(yr<1000)

yr+=1900;return yr;}document.write("<table width=486>");//don't delete this line


/* 每一段代表一种风格,不需要的删除即可*/


document.write("<TR><TD VALIGN=TOP><P>风格一<P></TD><TD VALIGN=TOP>"+isnDays[today.getDay()]

+","+isnMonths[today.getMonth()]+""+today.getDate()+"日,"

+getFullYear(today)+"年<P>");document.write("<TR><TD VALIGN=TOP>风格二<P></TD><TD VALIGN=TOP>"+clckh+":"+clckm

+":"+clcks+""+clck+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格三<P></TD><TD VALIGN=TOP>"

+isnDays[today.getDay()]+","+isnMonths[today.getMonth()]+""

+today.getDate()+"日,"+getFullYear(today)+"年 "+clckh+":"+clckm+":"

+clcks+""+clck+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格四<P></TD><TD VALIGN=TOP>"

+(today.getMonth()+1)+"/"+today.getDate()+"/"

+(getFullYear(today)+"").substring(2,4)+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格五:<P></TD><TD VALIGN=TOP>"+hrs+":"+clckm+":"+clcks+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格六:<P></TD><TD>"+today+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格七<P></TD><TD>"+navigator.appName+"<P></TD></TR>");document.write("<TR><TD VALIGN=TOP>风格八:<P></TD><TD VALIGN=TOP>"+navigator.appVersion+"<P></TD></TR>");document.write("</table>"); // don't delete this line

//-->


</SCRIPT>

</textarea>


<SCRIPT LANGUAGE="JavaScript">


<!-- hide


function goHist(a)


{


  history.go(a);


}


//-->


</script>


<FORM METHOD="post">

<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">

</form>

</center>

<br>

<br>

</body>

</html>

(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
本站页面浏览总量: