网页制作常用源代码
当前日历星期程序
例:2010年11月24日 星期三
<script language=JavaScript>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=##FF0000 style='font-size:10pt;font-family: 幼圆'> ",
Year(),"年",
Month()+1,"月",
Date(),"日 ",
Day()+1],
"</font>" );
</script>
放在页首的代码
<STYLE type=text/css>P {FONT-SIZE: 9pt}TD {FONT-SIZE: 9pt}
INPUT { FONT-SIZE: 9pt}SELECT { FONT-SIZE: 9pt}
A {TEXT-TRANSFORM: none; COLOR: #000000; TEXT-DECORATION: none}
A:hover {COLOR: #ff0080; TEXT-DECORATION: none}
A:active {COLOR: #ff0080; TEXT-DECORATION: none}
.subject {FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: none}
.title1 {FONT-SIZE: 12px; COLOR: #660000; TEXT-DECORATION: none}
.title1:hover {FONT-SIZE: 12px; COLOR: #669999}
.lianjie {FONT-SIZE: 12px; COLOR: #808080; TEXT-DECORATION: none}
.lianjie:hover {FONT-SIZE: 12px}
.zzz {FONT-SIZE: 12px; LINE-HEIGHT: 14px}
</STYLE>
</head>
<body>
<SCRIPT language=JavaScript>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4))
{
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) load
();
}
MM_reloadPage(true);
// -->
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && ElementById) ElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-
2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src;
x.src=a[i+2];}
}
//-->
</SCRIPT>
倒计时源代码
网页设计html代码大全空格<script language="JavaScript" type="text/javascript"><!--
BirthDay=new Date("February 14,2010");//改为计时日期
today=new Date();
timeold=(Time()-Time());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论