新建SQL函数标签,命名如:
连续滚动文章
查询语句:select TOP 20 ID,Title from KS_Article where rolls=1 order by id desc
显示前20条滚动文章
循环体:
<DIV id=demo onmouseover=ii=1 style="OVERFLOW: hidden; HEIGHT: 180px" onmouseout=ii=0>
<DIV id=demo1>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
[loop=20]
<tr>
<td><a href="{$Field(ID,GetInfoUrl,1,1)}">{$Field(Title,Text,0,,0,)}</a></td>
</tr>
[/loop]
</table>
</DIV>
<DIV id=demo2>
<SCRIPT>
var ii=0;t=demo.scrollTop
demo2.innerHTML=demo1.innerHTML
function qswhMarquee(){
if (ii==1)return
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else
demo.scrollTop++
}
setInterval(qswhMarquee,60)
</SCRIPT></DIV>
最后在模板中调用如{SQL_连续滚动文章()}