myway 发表于 2007-4-27 11:20:11

***时间日期***带显示时间的挂历

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果把如下代码加入到<body>区域中

<style>a.menuitem {
    color: menutext; text-decoration: none
}
a.menuitem:hover {
    color: highlighttext; background-color: highlight
}
div.contextmenu {
    border-right: 2px outset; border-top: 2px outset; z-index: 999; visibility: hidden; border-left: 2px outset; border-bottom: 2px outset; position: absolute; background-color: buttonface

}

</style>
<script language=javascript>
function year_month(){
    var now = new date();
    var yy = now.getyear();
    var mm = now.getmonth()+1;
    var cl = '<font color="#0000df">';
    if (now.getday() == 0) cl = '<font color="#c00000">';
    if (now.getday() == 6) cl = '<font color="#00c000">';
    return(cl +yy + '年' + mm + '月</font>'); }
function date_of_today(){
    var now = new date();
    var cl = '<font color="#ff0000">';
    if (now.getday() == 0) cl = '<font color="#c00000">';
    if (now.getday() == 6) cl = '<font color="#00c000">';
    return(cl +now.getdate() + '</font>'); }
function day_of_today(){
    var day = new array();
    day = "星期日";
    day = "星期一";
    day = "星期二";
    day = "星期三";
    day = "星期四";
    day = "星期五";
    day = "星期六";
    var now = new date();
    var cl = '<font color="#0000df">';
    if (now.getday() == 0) cl = '<font color="#c00000">';
    if (now.getday() == 6) cl = '<font color="#00c000">';
    return(cl +day + '</font>'); }
function curenttime(){
    var now = new date();
    var hh = now.gethours();
    var mm = now.getminutes();
    var ss = now.gettime() % 60000;
    ss = (ss - (ss % 1000)) / 1000;
    var clock = hh+':';
    if (mm < 10) clock += '0';
    clock += mm+':';
    if (ss < 10) clock += '0';
    clock += ss;
    return(clock); }
function refreshcalendarclock(){
document.all.calendarclock1.innerhtml = year_month();
document.all.calendarclock2.innerhtml = date_of_today();
document.all.calendarclock3.innerhtml = day_of_today();
document.all.calendarclock4.innerhtml = curenttime(); }
var weburl = weburl;
document.write('<table border="0" cellpadding="0" cellspacing="0"><tr><td>');
document.write('<table id="calendarclockfreecode" border="0" cellpadding="0" cellspacing="0" width="60" height="70" ');
document.write('style="position:absolute;visibility:hidden" bgcolor="#eeeeee">');
document.write('<tr><td align="center"><font ');
document.write('style="cursor:hand;color:#ff0000;font-family:宋体;font-size:14pt;line-height:120%" ');
if (weburl != 'netflower'){
   document.write('</td></tr><tr><td align="center"><font ');
   document.write('style="cursor:hand;color:#2000ff;font-family:宋体;font-size:9pt;line-height:110%" ');
}
document.write('</td></tr></table>');
document.write('<table border="0" cellpadding="0" cellspacing="0" width="61" bgcolor="#c0c0c0" height="70">');
document.write('<tr><td valign="top" width="100%" height="100%">');
document.write('<table border="1" cellpadding="0" cellspacing="0" width="58" bgcolor="#fefeef" height="67">');
document.write('<tr><td align="center" width="100%" height="100%" >');
document.write('<font id="calendarclock1" style="font-family:宋体;font-size:7pt;line-height:120%"> </font><br>');
document.write('<font id="calendarclock2" style="color:#ff0000;font-family:arial;font-size:14pt;line-height:120%"> </font><br>');
document.write('<font id="calendarclock3" style="font-family:宋体;font-size:9pt;line-height:120%"> </font><br>');
document.write('<font id="calendarclock4" style="color:#100080;font-family:宋体;font-size:8pt;line-height:120%"><b> </b></font>');
document.write('</td></tr></table>');
document.write('</td></tr></table>');
document.write('</td></tr></table>');
setinterval('refreshcalendarclock()',1000);
</script>

      










--------------------- -----------------

拥有三人行论坛管理系列软件,一个人就可以管理一个论 坛的更新维护。还能使您的论坛有千人在线的真实火暴效果, 让您不在为论坛因没有人气而留不住会员而烦 恼,使您的论坛早日成为一流的论坛。详情请登 陆网站:http : //www.cnsrx.cn 三人 行论坛管理软件,站长必备的专业好工具。(您使用的是免费版本,购买收费版 本后,将不带广 告。业务QQ:247216 449852 27)
页: [1]
查看完整版本: ***时间日期***带显示时间的挂历