在网上找的例子,演示的效果是循环滚动。自己模仿下来之后,滚动2圈之后就自动停止了。
代码如下:
<fieldset style="width:980px;height:100px;padding:1px;margin:0px auto 0px auto">
<table border="0" cellpadding="0" cellspacing="0" width="980">
<tr><td>
<div id="logo" align="center" style="overflow:hidden; height:100px; width:980px;">
<table align="center" cellpadding="0" cellspace="0" border="0">
<tr>
<td id="logo1" ><table border="0" cellpadding="0" cellspacing="0">
<tr>
<xsl:for-each select="LogoSYT/NodeIndex">
<td>
<a target="_blank" href="SytLogoDetail?fid={@fid}&id={@id}&type={attribute[@name='TYPE']/@value}" title="{attribute[@name='TITLE']/@value}">
<img style="pandding:5px" src="ViewImage?id={attribute[@name='APPENDIX']/@value}&fid={@fid}&useSmall=true" border="0" />
</a>
</td>
</xsl:for-each>
</tr>
</table>
</td>
<td id="logo2" valign="top" >
</td>
</tr>
</table>
</div>
<!--滚动特效的实现--!>
<script language="javascript">
<![CDATA[
var speed=10
logo2.innerHTML=logo1.innerHTML
function Marquee(){
if(logo2.offsetWidth-logo.scrollLeft<=0)
logo.scrollLeft-=logo1.offsetWidth
else{
logo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
logo.onmouseover=function() {clearInterval(MyMar)}
logo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
]]>
</script>
</td>
</tr>
</table>
</fieldset>
--
FROM 222.130.131.*