又出事了
javascript吧
全部回复
仅看楼主
level 1
纠结3月 楼主
下面是一段时间代码 秒数老在01-05秒之间改变 请大家帮忙看看那出问题了?
<script>
function dd()
{
var now=new Date();
var year=now.getYear();
var month=now.getMonth()+1;
var date=now.getDate()
return(+year+"年"+month+"月"+date+"日");
}
function wx()
{
var now=new Date();
var hh=now.getHours();
var mm=now.getMinutes();
var ss=now.getTime()%6000;
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 huoqu()
{
document.all.calendarClock1.innerHTML=wx();
document.all.calendarClock2.innerHTML=dd();
}
document.write('<font id="calendarClock2" style="color:#660033;font-size:12pt"></font>');
document.write('<font id="calendarClock1" style="color:#660033;font-size:12pt color"></font>');
setInterval('huoqu()',1000);
</script>
2011年06月13日 10点06分 1
level 4
6000少写一个0吧?
2011年06月13日 11点06分 2
level 10
出大事了 [啊!]
2011年06月13日 12点06分 3
level 11
对LZ发出警告: 发帖标题要写清楚,第三次发现删无赦.
2011年06月13日 16点06分 4
level 10
天啊 我发现一个惊天大bug[啊!]
2011年06月14日 00点06分 5
level 11
[歪头]
2011年06月14日 01点06分 6
level 7
我举个类似的例子而已[背扭]这算不算标题没写清楚咧(发现一个惊天大bug)
2011年06月14日 02点06分 7
level 1
纠结3月 楼主
这不是吸引观众的眼球吗?我上次的号不知道怎么就被封了!
我不是让你们在这里喷的 其实我用力一种方法也解决了
是这样的:
function wx()
{
var now=new Date();
var hh=now.getHours();
var mm=now.getMinutes();
var ss=now.getSeconds();
var clock=hh+':';
if(mm<10) clock +='0';
clock+=mm+':';
if(ss<10) clock+='0';
clock+=ss;
return(clock);
}
这样更能看的懂 那个发放有点晕
2011年06月14日 03点06分 8
level 9
终于解封了。[拍砖]
2011年06月14日 04点06分 9
level 11
不是我干的...
那是冰冻时间到了,自然融化.
[飘过]
2011年06月14日 04点06分 10
level 9
2011年06月14日 05点06分 11
level 1
[打酱油]
2011年06月15日 07点06分 12
1