1、如何在表格里实时显示当前时间?<script>
function showtime(){
document.all.currtime.innerHTML=new Date().toLocaleString(); 
setTimeout("showtime()",1000)
}
window.onload=showtime
</script>
<table><tr><td id=currtime>&nbsp;</td></tr></table>2、如何在我需要的地方(如CSDN上的一样)实现跑马灯效果?
<marquee>如何在我需要的地方(如CSDN上的一样)实现跑马灯效果?</marquee>

解决方案 »

  1.   

    <input size=9 type=text name=clock style="border:solid 1px #FFFFFF"><script language="Javascript"><!--
    function timer()
    {
      now = new Date();
      h = (now.getHours()   > 9) ? now.getHours()   : "0" + now.getHours();
      m = (now.getMinutes() > 9) ? now.getMinutes() : "0" + now.getMinutes();
      s = (now.getSeconds() > 9) ? now.getSeconds() : "0" + now.getSeconds();
      clock.value =""+h+":"+m+":"+s+"";
      setTimeout( 'timer()',1000);
    } timer();
    // --></script>我看看一些基础的书.
      

  2.   

    楼上的兄弟说的不错,但当页面比较大的时候,就不好,可以直接用函数interval("showtime()";1000),这样就不要从载页面了。
      

  3.   

    1.<html>
    <head>
    <title>新增集团成员</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language="JavaScript">function GetTimeTest(){
       var d, s, t;
       var MinMilli = 1000 * 60;
       var HrMilli = MinMilli * 60;
       var DyMilli = HrMilli * 24;
       d = new Date();
       var h = d.getHours();
       var m  = d.getMinutes();
       var s = d.getSeconds();
       s = h +":" +  m +":" +  s;
       document.all.aa.innerText = s;
    }
    </script>
    </head>
    <body bgcolor="#F3F7FB" text="#000000" onload="GetTimeTest()">
    <table><tr><td id="aa">
    </td></tr></table>
    </body>
    </html>2.<marquee> 就可以实现跑马灯效果。</marquee> 
      

  4.   

    <marquee direction="up">如何在我需要的地方(如CSDN上的一样)实现跑马灯效果?</marquee>