教您自定義SQL函數(shù)標(biāo)簽實現(xiàn)連續(xù)滾動文章的方法
如果需要實現(xiàn)連續(xù)滾動文章效果,應(yīng)該采用什么方法呢?下面就教您自定義SQL函數(shù)標(biāo)簽實現(xiàn)連續(xù)滾動文章的方法,供您參考,希望對您SQL函數(shù)標(biāo)簽的學(xué)習(xí)能有所幫助。
新建SQL函數(shù)標(biāo)簽,命名如:
連續(xù)滾動文章
查詢語句:select TOP 20 ID,Title from KS_Article where rolls=1 order by id desc
顯示前20條滾動文章
循環(huán)體:
<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>
***在模板中調(diào)用如{SQL_連續(xù)滾動文章()}
【編輯推薦】