<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD> <BODY>
  <script>
  
function $(id) { return document.getElementById(id); }
function moveElement(elementID,final_y,interval) {
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.top) {
    elem.style.top = "0px";
  }
  var ypos = parseInt(elem.style.top);
  if (ypos == final_y) {
return true;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/10);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/10);
    ypos = ypos - dist;
  }
  elem.style.top = ypos + "px";
  var repeat = "moveElement('"+elementID+"',"+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}
var ad_time=1*1000;
var picheight=-68;
var picsign=1;
setInterval('autoiFocus()',ad_time);
//var atuokey = false;
function autoiFocus() { if(!$('ifocus')) return false;
    //$('ifocus_pic').innerHTML = $('ifocus_piclist').innerHTML + $('ifocus_piclist').innerHTML;
if (picsign==1&&document.getElementById('img2').href!="http:///"){
    picsign++;
    moveElement('ifocus_piclist',picheight,5);
}
else if (picsign==2&&document.getElementById('img3').href!="http:///"){
    picsign++;
    moveElement('ifocus_piclist',picheight*2,5);
}
else if (picsign==3&&document.getElementById('img4').href!="http:///"){
picsign=1;
    moveElement('ifocus_piclist',0,5);
}}
document.write("<div id='ifocus' style='overflow:hidden'>");
document.write(" <div id='ifocus_pic' style='display:inline; position:relative; float:left; width:290px; height:68px; overflow:hidden; '>");
document.write(" <div id='ifocus_piclist' style='left:-40px; top:0px; position:absolute;'>");
document.write(" <ul style='list-style:none;margin-top:0px;'>");
document.write(" <li style='list-style:none; width:290px; height:68px; overflow:hidden;'><a id='img1' href='@[ad_link1]'><img style='width:290px; height:68px;border:none;' src='http://i1.6.cn/7a/60/h450081244163854.jpg' alt='' /></a></li>");
document.write(" <li style='list-style:none; width:290px; height:68px; overflow:hidden;'><a id='img2' href='@[ad_link2]'><img style='width:290px; height:68px;border:none;' src='http://i2.6.cn/a5/e5/n948391244539267.jpg' alt='' /></a></li>");
document.write(" <li style='list-style:none; width:290px; height:68px; overflow:hidden;'><a id='img3' href='@[ad_link3]'><img id='img3'style='width:290px; height:68px;border:none;' src='http://i3.6.cn/f9/8a/k837331244192528.jpg' alt='' /></a></li>");
document.write(" <li style='list-style:none; width:290px; height:68px; overflow:hidden;'><a id='img4' href='@[ad_link4]'><img id='img4'style='width:290px; height:68px;border:none;' src='http://' alt='' /></a></li>");
document.write(" </ul>");
document.write(" </div>");
document.write(" </div>");
document.write("</div>");
  </script> </BODY>
</HTML>
现在代码123后又倒退到1 我想要123然后直接同样顺序的出现1 

解决方案 »

  1.   

    <div id="picrun" style="height:305px;overflow:hidden;width:610px;border:5px solid #006600">
    <a href=""><img src="http://www.nghdw.com/img/image1.jpg" border="0" width="610" height="305"/></a><a href=""><img src="http://www.nghdw.com/img/image2.jpg" border="0" width="610" height="305"/></a><a href=""><img src="http://www.nghdw.com/img/image3.jpg" border="0" width="610" height="305"/></a><a href=""><img src="http://www.nghdw.com/img/image4.jpg" border="0" width="610" height="305"/></a><a href=""><img src="http://www.nghdw.com/img/image5.jpg" border="0" width="610" height="305"/></a></div>
    <script type="text/JavaScript">
    var oMarquee = document.getElementById("picrun"); //滚动对象
    var iLineHeight = 305; //单行高度,像素
    var iLineCount = 5; //实际行数
    var index=0;
    function run() {
    oMarquee.scrollTop += Math.ceil(((index+1)*iLineHeight-oMarquee.scrollTop)*0.2);
    if ( oMarquee.scrollTop == iLineCount * iLineHeight )
    oMarquee.scrollTop = index=0;
    var speed=1;
    if ( oMarquee.scrollTop % iLineHeight == 0 ) {
    speed=1000;if(oMarquee.scrollTop!=0)index++;
    }
    window.setTimeout( "run()", speed);
    }
    oMarquee.innerHTML += oMarquee.innerHTML;
    window.setTimeout( "run()", 1000 );</script>给你个简单实用,还兼容FF的滚动代码,效果跟你的是一样的
      

  2.   

    用缓动写其实挺简单的  你可以看下cloudgamer里面记的Tween算法.
    <!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=gb2312" />
    <title>XXXXX</title>
    <style type="text/css"></style>
    </head>
    <body style=" padding:0px; margin:0px; font-size:12px;">
    <div id='ss' style=" height:68px; width:290px; overflow:hidden;">
         <div style="width:290px; height:272px;">
        <div><img src ='http://i1.6.cn/7a/60/h450081244163854.jpg'></div>
    <div><img src ='http://i2.6.cn/a5/e5/n948391244539267.jpg'></div>
    <div><img src='http://i3.6.cn/f9/8a/k837331244192528.jpg'></div>
    <div><img src ='http://i1.6.cn/7a/60/h450081244163854.jpg'></div>
     </div>
    </div>
    <script>
    function $(Id){return document.getElementById(Id)};var Tween = {
        Elastic: {
            easeOut: function(t,b,c,d){
    return c*((t=t/d-1)*t*t + 1) + b;
            }
        }
    }
    var t=i=b=c=0,d=20;
    c = $('ss').getElementsByTagName('img')[0].parentNode.offsetHeight;
    function Run(){
    $('ss').scrollTop = Math.round(Tween.Elastic.easeOut(++t,b,c,d));
    if(t<d){setTimeout(Run, 10);return;}
        if(i==$('ss').getElementsByTagName('img').length-1)
     {i=0;b=0; t=0;$('ss').scrollTop=0;Run();return}
    i++;b=i*c;t=0;setTimeout(Run, 1000);
    }
    Run();
    </script></body>
    </html>
      

  3.   

    http://www.google.cn/search?hl=zh-CN&q=%E5%90%91%E4%B8%8A%E9%97%B4%E6%AD%87%E6%BB%9A%E5%8A%A8%E5%9B%BE%E7%89%87JS&meta=lr%3Dlang_zh-CN&aq=f&oq=