| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 668 人关注过本帖
标题:怎样才能给asp主页加上和系统挂钩的时钟?
只看楼主 加入收藏
hnegz
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2007-10-18
收藏
 问题点数:0 回复次数:3 
怎样才能给asp主页加上和系统挂钩的时钟?
怎样才能给asp主页加上和系统挂钩的时钟?平时用的是静止的,我想改成走动的,怎么改?
搜索更多相关主题的帖子: 主页 时钟 系统 asp 挂钩 
2007-10-19 04:40
永夜的极光
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2721
专家分:1
注 册:2007-10-9
收藏
得分:0 
打开记事本,复制以下代码,然后保存为index.html,然后直接双击用浏览器打开,查看效果

<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />
<title></title>
<script language=JavaScript>
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
function startclock () {
stopclock();
showtime();}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = \"\" +((hours >= 12) ? \"下午 \" : \"上午 \" )
if(hours<=4){timeValue=\"凌晨\";}
if(hours>4&&hours<=11){timeValue=\"上午\";}
if(hours>11&&hours<=13){timeValue=\"中午\";}
if(hours>13&&hours<=18){timeValue=\"下午\";}
if(hours>18&&hours<=24){timeValue=\"晚上\";}
timeValue += ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? \":0\" : \":\") + minutes
timeValue += ((seconds < 10) ? \":0\" : \":\") + seconds
document.clock.thetime.value = timeValue;
timerID = setTimeout(\"showtime()\",1000);
timerRunning = true;}
</SCRIPT>
</head>
<body topmargin=\"0\">
<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<form name=clock>
<td bgcolor=\"#eef0f8\" align=\"center\"><input name=thetime type=\"text\" style=\"font-size: 12pt;color:#000000;border:0;background-color: #eef0f8;\" size=\"12\" readonly=\"true\">
</td>
</form>
<script language=\"javascript\">
startclock ();
</script>
</tr>
</table>
</body>
</html>

[此贴子已经被作者于2007-10-19 10:54:10编辑过]


从BFS(Breadth First Study)到DFS(Depth First Study)
2007-10-19 10:52
那边有朵蘑菇云
Rank: 1
来 自:很……那啥的一个地方
等 级:新手上路
威 望:1
帖 子:390
专家分:0
注 册:2007-9-3
收藏
得分:0 
定了 VB里用TIMER控件可以实现
ASP我就不知道了 看这个帖子 才让我明白了 我靠 我脑袋上的疑云越来越重了
代码完全看不懂 我汗

身不残 志更不坚
2007-10-19 15:06
hnegz
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2007-10-18
收藏
得分:0 
谢谢,我试了能用,太谢谢
2007-10-20 12:18
快速回复:怎样才能给asp主页加上和系统挂钩的时钟?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015710 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved