日期:2014-05-18  浏览次数:20412 次

求此一网站的图片滚动代码
求此一网站的图片滚动代码
http://www.chinaxyz.org/index.asp
该网站的中部有一个“知名企业”的图片滚动功能,求类似此功能的代码,请高手帮忙。
  本人原打算用 <marquee> 来实现此功能,但是   <marquee> 只能是从一端滚动到另一端,刚开始滚动会有一段很大的空白空间,很是难看。


------解决方案--------------------
网站很难打开
scrollpic.js代码
var speed3=25//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft <=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed3)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}

html代码:

<html>
<head>
<title> qq </title>
<body>
<CENTER>
<TABLE style= "BORDER: #ccc 1px solid; " cellSpacing=0 cellPadding=0 width=750 align=center border=0>
<TBODY>
<TR>
<TD>
<DIV id=demo style= "OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff ">
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace= "0 ">
<TBODY>
<TR>
<TD id=demo1 vAlign=top> <table width= "1710 " height= "116 " border= "0 " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 1 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center ">
<p> 2 </p>
</div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 3 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 4 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 5 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 6 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 7 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 8 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 9 </div> </td>
<td width= "171 " background= "images/pic_bg.jpg "> <div align= "center "> 10 </div> </td>
</tr>
</table> </TD>
<TD id=demo2 vAlign=top> &nbsp; </TD> </TR> </TBODY> </TABLE> </DIV>
<script language=JavaScript src= "scrollpic.js "> </script>
</TD> </TR> </TBODY> </TABLE> </TD> </TR> </TABLE>
</CENTER>
</BODY> </HTML>