rt,比如:http://www.paipai.com/sale/freeze/index.html?PTAG=30895.58.4这个页面的?

解决方案 »

  1.   

    在javascritp中,有两个关于定时器的专用函数
    1.倒计定时器:timename=setTimeout("function();",delaytime);2.循环定时器:timename=setInterval("function();",delaytime); <%@ page contentType="text/html; charset=gb2312" %>
    <html>
    <SCRIPT LANGUAGE="JavaScript">
    setTimeout("confirm('确实在测试定时功能?')",1000);
    function count() {
        setTimeout("alert('三秒到了')",3000)
    }
    </Script>
    <body>
    <INPUT TYPE="button" VALUE=" 计时开始" onClick="count()">
    </body>
    </html>大概这样  要做那个 你自己研究下
      

  2.   

    一张图片,来回切换位置。很简单的代码图片地址:
    http://static.paipaiimg.com/index_v2/sale_v2/freeze/bg_950.png
      

  3.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
    <title>Insert title here</title>
    <style type="text/css">
    .time {
    background-image: url(bg_950.png);
    background-repeat: no-repeat;
    display: inline-block;
    width: 12px;
    height:21px;
    }
    .t0 {
    background-position: -680px -180px;
    }
    .t1 {
    background-position: -692px -180px;
    }
    .t2 {
    background-position: -704px -180px;
    }
    .t3 {
    background-position: -719px -180px;
    }
    .t4 {
    background-position: -736px -180px;
    }
    .t5 {
    background-position: -751px -180px;
    }
    .t6 {
    background-position: -767px -180px;
    }
    .t7 {
    background-position: -782px -180px;
    }
    .t8 {
    background-position: -798px -180px;
    }
    .t9 {
    background-position: -814px -180px;
    }
    .t {
    background-position: -828px -180px;
    }
    </style>
    <script type="text/javascript">
    window.onload = function() {
    var timer = document.getElementById("timer"); setInterval(function() {
    removeAllItem(timer); renderTime(timer);

    }, 1000);

    } function removeAllItem(timerDiv) {
    while (timerDiv.childNodes.length > 0) {
    timerDiv.removeChild(timerDiv.childNodes[0]);
    }
    } function renderTime(timerDiv) { var date = new Date(); var hour = date.getHours();

    var minute = date.getMinutes(); var second = date.getSeconds(); render(hour, timerDiv);
    render(null, timerDiv);
    render(minute, timerDiv);
    render(null, timerDiv);
    render(second, timerDiv);
    } function render(num, timerDiv) {
    if (num == null) {
    addSpan(timerDiv, "t");
    } else {
    var first = parseInt(num / 10, 10);
    var second = num % 10;
    addSpan(timerDiv, "t" + first);
    addSpan(timerDiv, "t" + second);
    }
    } function addSpan(timerDiv, styleName) {
    var span = document.createElement("span");
    span.className = "time " + styleName;
    timerDiv.appendChild(span);
    }</script>
    </head>
    <body>
    <div id="timer">
    </div>
    </body>
    </html>
    把上次回帖的图片放在这个文件的同级目录,在url(bg_950.png);能读到的地方就行了