dede图片横向滚动

<div id=demo style="overflow:hidden; width:960px;" >
<table border=0 align="center" cellpadding=1 cellspacing=1>
<tr><td valign="top" bgcolor="#FFFFFF" id=marquePic1>
<table width='100%' border='0' cellspacing='0'align='center'>

<tr><!--这里的图片暂时是调用:图片中心的[图片太少的话就会滚一下就停了]-->
{dede:arclist row='8' typeid='2' orderby='pubdate' type='image.' imgwidth='125' imgheight='90'}
<td>
<a href="[field:arcurl/]">[field:image/]</a>
</td>
{/dede:arclist}

</tr>

</table>
</td><td id=marquePic2 valign=top></td></tr>
</table>
</div>
<!--滚动图结束-->

<!--滚动图片的js-->
<script type="text/javascript">
var speed=18
marquePic2.innerHTML=marquePic1.innerHTML
function Marquee(){
if(demo.scrollLeft>=marquePic1.scrollWidth){
demo.scrollLeft=0
}else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

posted on 2014-03-09 20:57  北海盗  阅读(2056)  评论(0编辑  收藏  举报