欢迎各位兄弟 发布技术文章
这里的技术是共享的
<div id="demo2" style="overflow:hidden;width:100px;height:200px;border:1px solid red;">
<table cellpadding="1" cellspacing="1">
<tr>
<td valign="top" id="marquePic21">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr align="center">
<td><img src="img.gif" width="70" height="70" border="0"></td>
</tr>
<tr align="center">
<td><img src="img.gif" width="70" height="70" border="0"></td>
</tr>
<tr align="center">
<td><img src="img.gif" width="70" height="70" border="0"></td>
</tr>
<tr align="center">
<td><img src="img.gif" width="70" height="70" border="0"></td>
</tr>
<tr align="center">
<td><img src="img.gif" width="70" height="70" border="0"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="marquePic22" valign="top"></td>
</tr>
</tr>
</table>
</div>
<script language="javascript">
var marquePic22=document.getElementById('marquePic22');
var marquePic21=document.getElementById('marquePic21');
var demo2=document.getElementById('demo2');
var speed2=30;
marquePic22.innerHTML=marquePic21.innerHTML;
function Marquee2(){
if(demo2.scrollTop>=marquePic21.scrollHeight){
//demo向上滚动的距离,, 如果大于marquePic1的高度
demo2.scrollTop=0;
}else{
demo2.scrollTop++;
}
}
var MyMar2=setInterval(Marquee2,speed2);
demo2.onmouseover=function() {clearInterval(MyMar2);MyMar2=null;}
demo2.onmouseout=function() {MyMar2=setInterval(Marquee2,speed2)}
</script>