html 布局结构
<table width="2200px" id="demoTable" border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >
<tr>
<td valign=top id=marquePic1>
<table width='100%' border='0' cellspacing='0'>
<tr>
<td align=center><a class="zt_wrap"> <img src="${_b}/style/image/web/pic_zt01.jpg" width="165" height="97">
<div>正定位于冀中平原正定位于冀中平原</div>
</a></td>
<td align=center><a class="zt_wrap"> <img src="${_b}/style/image/web/pic_zt02.jpg" width="165" height="97">
<div>正定位于冀中平原正定位于冀中平原</div>
</a></td>
<td align=center><a class="zt_wrap"> <img src="${_b}/style/image/web/pic_zt03.jpg" width="165" height="97">
<div>正定位于冀中平原正定位于冀中平原</div>
</a></td>
<td align=center><a class="zt_wrap"> <img src="${_b}/style/image/web/pic_zt04.jpg" width="165" height="97">
<div>正定位于冀中平原正定位于冀中平原</div>
</a></td>
<td align=center><a class="zt_wrap"> <img src="${_b}/style/image/web/pic_zt05.jpg" width="165" height="97">
<div>正定位于冀中平原正定位于冀中平原</div>
</a></td>
<td align=center><a class="zt_wrap" href="./sjshow" target ="_blank"> <img src="${_b}/style/image/web/pic_zt06.jpg" width="165" height="97">
<div>正定自贸区展示图正定自贸区展示图</div>
</a></td>
</tr>
</table>
</td><td id=marquePic2 valign=top></td>
</tr>
</table>
js 代码:
var marquePic1 = document.getElementById("marquePic1");
var marquePic2 = document.getElementById("marquePic2");
marquePic2.innerHTML=marquePic1.innerHTML;
var numLeft = 0;
function Marqueei(){
var demoi = document.getElementById("demoi");
if(numLeft>=marquePic1.scrollWidth){
numLeft = 0;
demoi.scrollLeft = 0;
}else{
numLeft ++;
demoi.scrollLeft = numLeft;
}
}
var MyMari=setInterval(Marqueei,30);
demoi.onmouseover=function() {clearInterval(MyMari)}
demoi.onmouseout=function() {MyMari=setInterval(Marqueei,30)}
结果: