58、带倒影的时间
类别: JavaScript教程
===1、将以下代码加入HTML的<HEAD></HEAD>之间
<style type="text/css">
<!-- .time{font-family : Comic Sans Ms;
font-size : 14pt;font-weight : bold;color: #00008D;}-->
</style><style type="text/css"><!-- .time{
font-family : Comic Sans Ms;font-size : 14pt;
font-weight : bold;color: #00008D;}-->
</style>
<script Language="JavaScript">
<!-- Hiding
var ctimer;
function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}
function settimes(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=hours+":"+mins+":"+secs
tim2.innerHTML=hours+":"+mins+":"+secs
ctimer=setTimeout(\'settimes()\',960);
}
// --></script>
====2、将以下代码加入HEML的<BODY></BODY>之间
<body onLoad="init()">
<div Id="tim1" Style="position:absolute; width:10; height:10; top:10; left:50"
class="time"></div><div Id="tim2"
Style="position:absolute; filter:flipv() alpha(opacity=20); font-style:italic"
class="time">
<p> </p>
</div>
</body>
<script Language="JavaScript">
<!-- Hiding
var ctimer;
function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}
function settimes(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=hours+":"+mins+":"+secs
tim2.innerHTML=hours+":"+mins+":"+secs
ctimer=setTimeout(\'settimes()\',960);
}
// --></script>
<style type="text/css">
<!-- .time{font-family : Comic Sans Ms;
font-size : 14pt;font-weight : bold;color: #00008D;}-->
</style><style type="text/css"><!-- .time{
font-family : Comic Sans Ms;font-size : 14pt;
font-weight : bold;color: #00008D;}-->
</style>
<script Language="JavaScript">
<!-- Hiding
var ctimer;
function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}
function settimes(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=hours+":"+mins+":"+secs
tim2.innerHTML=hours+":"+mins+":"+secs
ctimer=setTimeout(\'settimes()\',960);
}
// --></script>
====2、将以下代码加入HEML的<BODY></BODY>之间
<body onLoad="init()">
<div Id="tim1" Style="position:absolute; width:10; height:10; top:10; left:50"
class="time"></div><div Id="tim2"
Style="position:absolute; filter:flipv() alpha(opacity=20); font-style:italic"
class="time">
<p> </p>
</div>
</body>
<script Language="JavaScript">
<!-- Hiding
var ctimer;
function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}
function settimes(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=hours+":"+mins+":"+secs
tim2.innerHTML=hours+":"+mins+":"+secs
ctimer=setTimeout(\'settimes()\',960);
}
// --></script>
- 上一篇: 57、当前时间
- 下一篇: 59、跟随鼠标的十字架
-= 资 源 教 程 =-
文 章 搜 索