怎样修改一下代码就可是实现横向滚动显示图片呢,请教各位!
<div id=demo style="OVERFLOW: hidden; WIDTH: 160px; COLOR: #ffffff; HEIGHT: 240px">
<div id=demo1>
<center>
<!--从这里开始换成你的内容-->
<%
set rs=conn.execute("select top 6 * from photo order by addtime desc")
do while not rs.eof
%>
<a href="photo_browse.asp?id=<%=rs("id")%>"><img src="picslt/<%=rs("picslt")%>" width="90" height="120"></a>
<%
rs.movenext
loop
rs.close()
set rs = nothing
%>
<!--内容结束-->
</center>
</div>
<div id=demo2></div>
</div>
<SCRIPT Language="JavaScript">
demo2.innerHTML = demo1.innerHTML; //克隆demo1为demo2
var speed = 30; //滚动速度,数字越小速度越快
function Marquee(){
//内容滚动主函数
if(demo2.offsetTop-demo.scrollTop<=0){
//当滚动至demo1与demo2交界时
demo.scrollTop-=demo1.offsetHeight; //demo跳到最顶端
}else{
demo.scrollTop++;
}
initialize();
}
function initialize(){
timer = setTimeout("Marquee()", speed);
}
function StopMarquee(){
clearInterval(timer);
//清除定时器达到滚动停止的目的
}
initialize();
demo.onmouseover=StopMarquee //鼠标移上时清除定时器达到滚动停止的目的
demo.onmouseout=initialize //鼠标移开时重设定时器
</SCRIPT>