本帖最后由 goths 于 2013-04-12 17:50:40 编辑

解决方案 »

  1.   

    <!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=utf-8" />
    <title>无标题文档</title>
    </head><body>
    离活动结束时间只有<idv id="_lefttime" style="color:#0F0;font-size:18pt; font-family:微软雅黑;"></div><SCRIPT LANGUAGE="JavaScript">
    function _fresh()
    {
    var L=new Array()
    L[0]="http://img04.taobaocdn.com/imgextra/i4/1615888182/T2.hXHXoXaXXXXXXXX_!!1615888182.gif"
    L[1]="http://img01.taobaocdn.com/imgextra/i1/1615888182/T2LUvKXoFXXXXXXXXX_!!1615888182.gif"
    L[2]="http://img01.taobaocdn.com/imgextra/i1/1615888182/T2RMfLXa4XXXXXXXXX_!!1615888182.gif"
    L[3]="http://img04.taobaocdn.com/imgextra/i4/1615888182/T2xQRVXl0dXXXXXXXX_!!1615888182.gif"
    L[4]="http://img01.taobaocdn.com/imgextra/i1/1615888182/T2WqTLXl4XXXXXXXXX_!!1615888182.gif"
    L[5]="http://img03.taobaocdn.com/imgextra/i3/1615888182/T2_lfFXlxaXXXXXXXX_!!1615888182.gif"
    L[6]="http://img04.taobaocdn.com/imgextra/i4/1615888182/T2WdzKXlpaXXXXXXXX_!!1615888182.gif"
    L[7]="http://img04.taobaocdn.com/imgextra/i4/1615888182/T2dEnKXf4XXXXXXXXX_!!1615888182.gif"
    L[8]="http://img04.taobaocdn.com/imgextra/i4/1615888182/T2dEnKXf4XXXXXXXXX_!!1615888182.gif"
    L[9]="http://img03.taobaocdn.com/imgextra/i3/1615888182/T2Gr6KXXXaXXXXXXXX_!!1615888182.gif" var endtime=new  Date("Apr 13 2013 13:08:43");
     var nowtime = new Date();
     var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
     if(leftsecond<0){leftsecond=0;}
     __e=Date();
     __d=parseInt(leftsecond/3600/24);
     __h=parseInt((leftsecond/3600)%24);
     __m=parseInt((leftsecond/60)%24);
     __s=parseInt(leftsecond%60);
     __all = __d+"天 "+__h+"小时"+__m+"分"+__s+"秒"
     __all = __all.replace(/(\d{1})/g,function(a){
    return "<img width=16 height=21 src="+L[a]+">";
      
       });
     document.getElementById("_lefttime").innerHTML=__all;
    }
    _fresh()
    setInterval(_fresh,1000);
    </SCRIPT>
    </body>
    </html>
    这样试试