功夫不负有心人,我终于研究出来了。和大家共享一下
做一个SQL标签
语句如下:select ID,Tid,Title,Picurl,Intro from KS_Article where Tid='20092814738069' and deltf=0 and verific=1 and picnews=1 and Rolls=1 order by id desc
循环体:
<div align='center' id='demo' style='overflow:hidden;height:150px;width:500px;'><!--滚动区的高度和宽度-->
<table align='center' cellpadding='0' cellspace='0' border='0'>
<tr>
<td id='demo1' valign='top'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
[loop=20]
<td align='center'>
<TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0>
<TR>
<TD > </TD>
<TD width="170" height="150" align="center" bgcolor="#E9E9E9">
<a title={$Field(Title,Text,0,,0,)} href="{$Field(ID,GetInfoUrl,1,1)}" target=_blank >
<img alt={$Field(Title,Text,0,,0,)} src="{$Field(Picurl,Text,0,,0,)}" width="161" height="149" border="0" >
</a>
</TD>
</TR>
</TABLE>
</td>
[/loop]
</tr>
</table>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<script>
var Picspeed=1
demo2.innerHTML=demo1.innerHTML
function swj1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(swj1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(swj1,Picspeed)}
</script>
查询语句可以按自己想法改变其它