日期:2014-05-17 浏览次数:20720 次
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 200px; HEIGHT: 120px" align=center>
<DIV id=demo1>
<DIV> </DIV>
<img src="http://profile.csdn.net/kaukiyou/picture/2.jpg" /> <br>
<img src="http://profile.csdn.net/kaukiyou/picture/2.jpg" /> <br>
<img src="http://profile.csdn.net/kaukiyou/picture/2.jpg" /> <br>
<DIV>
<TABLE cellPadding=2 width="100%" border=0>
<TBODY> </TBODY> </TABLE> </DIV> </DIV>
<DIV id=demo2> </DIV> </DIV>
<SCRIPT language=javascript type=text/javascript>
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10, offset=50;
var MyMar = setInterval(Marquee,speed);
demo2.innerHTML = demo1.innerHTML;
function doTimeout(){
if (!MyMar) MyMar = setInterval(Marquee,speed);
}
function Marquee(){
if(demo2.offsetTop-demo.scrollTop <=0) {
demo.scrollTop-=demo1.offsetHeight;
}else{
demo.scrollTop++
offset--;
if (offset <0) {
clearInterval(MyMar);
MyMar=0;offset=50;
setTimeout(doTimeout, 2000);
}
}
}
demo.onmouseover = function(){clearInterval(MyMar);MyMar=0;}
demo.onmouseout = function(){if(!MyMar)MyMar = setInterval(Marquee,speed);}
-->
</SCRIPT>