看下面的代码 是图片循环左移的代码 可是当我换成struts标签后就不能运行了 为什么
<div id=demo style="overflow:hidden;height:100px;width:494px;">
<table align=left
cellpadding=0 cellspace=0 border=0>
<tr><td id=demo1 valign=top>
<logic:notEmpty name="indexForm" property="productList">
<logic:iterate id="product" name="indexForm" property="productList">
<A href="<%=basePath%>product.do?act=findByIdForView&id=${product.id}" title="点击查看详细" target=_blank><IMG
src="<%=basePath%>data/products/<bean:write name="product" property="picturePath"/>"
width=100 border="0" height=100/> </A></logic:iterate></logic:notEmpty>
</td><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<div id=demo style="overflow:hidden;height:100px;width:494px;">
<table align=left
cellpadding=0 cellspace=0 border=0>
<tr><td id=demo1 valign=top>
<logic:notEmpty name="indexForm" property="productList">
<logic:iterate id="product" name="indexForm" property="productList">
<A href="<%=basePath%>product.do?act=findByIdForView&id=${product.id}" title="点击查看详细" target=_blank><IMG
src="<%=basePath%>data/products/<bean:write name="product" property="picturePath"/>"
width=100 border="0" height=100/> </A></logic:iterate></logic:notEmpty>
</td><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货