回楼上:
建自定义SQL标签:{SQL_获取滚动图片地址()}
SQL语句:select top 6 ID,title,Picurl from KS_Article where Rolls=1 and Verific=1 and deltf=0 order by id desc 注意蓝色部分的查询条件
循环体:
[loop=6]<img src="{$Field(PicUrl,Text,0,...,0,)}" />[/loop]
模板中调用:
<div>
<div onmousedown=goright() style="DISPLAY: inline; BACKGROUND: url(http://i3.sinaimg.cn/edu/deco/2007/0924/career/job_mj_069.gif) no-repeat 11px 0px; FLOAT: left; MARGIN: 25px 0px 0px; OVERFLOW: hidden; WIDTH: 19px; CURSOR: pointer; HEIGHT: 52px"></div>
<div id=demo style="FLOAT: left; OVERFLOW: hidden; WIDTH: 150px; HEIGHT: 100px">
<table cellPadding=0 align=left border=0 cellspace="0">
<tr>
<td id=demo1 vAlign=top>{SQL_获取滚动图片地址()}</td>
<td id=demo2 vAlign=top>{SQL_获取滚动图片地址()}</td>
</tr>
</table>
</div>
<div onmousedown=goleft() style="DISPLAY: inline; BACKGROUND: url(http://i3.sinaimg.cn/edu/deco/2007/0924/career/job_mj_069.gif) no-repeat -8px 0px; FLOAT: left; MARGIN: 25px 0px 0px; OVERFLOW: hidden; WIDTH: 20px; CURSOR: pointer; HEIGHT: 52px"></div></div>
<SCRIPT>
var speed=30
var MoveTimeObj;
var MyMar;
demo2.innerHTML=demo1.innerHTML
demo.scrollLeft=demo.scrollWidth
function Marqueeright()
{
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
function Marqueeleft(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
function MoveRight()
{
MyMar=setInterval(Marqueeright,30)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marqueeright,30)}
}
function MoveLeft()
{
MyMar=setInterval(Marqueeleft,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marqueeleft,speed)}
}
function goright()
{
clearInterval(MyMar);
MoveRight();
}
function goleft()
{
clearInterval(MyMar);
MoveLeft();
}
</SCRIPT>