1、后台 门户-模块管理-添加附件模块2、取名称“带方向图片连续滚动”3、粘贴如下代码:
代码 复制 – 运行
|
|
<div class=”module cl”>
<table align=”center” border=”0″ width=”940″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”11″><img id=”r_l”src=”static/image/common/panpanluo_button_l.gif”>
</td>
<td>
<TABLE cellSpacing=0 cellPadding=0 width=916 border=0>
<TBODY>
<TR>
<TD vAlign=top background=””>
<TABLE cellSpacing=0 cellPadding=0 width=916 border=0>
<TBODY>
<TR>
<TD vAlign=center align=middle >
<DIV id=demo style=”OVERFLOW: hidden; WIDTH: 916px; COLOR: #ffffff; “>
<TABLE cellPadding=0 width=”100%” align=left border=0
cellspace=”0″>
<TBODY>
<TR>
<TD id=demo1 vAlign=top>
<TABLE cellSpacing=1 cellPadding=1>
<TBODY>
<TR vAlign=top>
<TD vAlign=top noWrap>
<DIV align=right>
<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
[loop]
<TD align=middle>
<TABLE cellSpacing=0 cellPadding=0 width=120
align=center border=0>
<TBODY>
<TR>
<TD align=middle >
<a href=”{url}”{target}><img src=”{pic}” width=”{picwidth}” height=”{picheight}” alt=”{title}” /></a>
</TD></TR>
<TR>
<TD class=nav1 align=middle ><A
class=apm2
href=”{url}” title=”{title}”{target}>{title}</A></TD></TR></TBODY></TABLE></TD>
[/loop] </TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></TD>
<TD id=demo2 width=”0″></TD>
</TR></TBODY></TABLE></DIV>
<SCRIPT>
var dir=1//每步移动像素,数大为快
var speed=1//循环周期(毫秒)数大为慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){//正常移动
//alert(demo2.offsetWidth+”\n”+demo.scrollLeft)
if (dir>0 && (demo2.offsetWidth-demo.scrollLeft)<=0) demo.scrollLeft=0
if (dir<0 &&(demo.scrollLeft<=0)) demo.scrollLeft=demo2.offsetWidth
demo.scrollLeft+=dir
demo.onmouseover=function() {clearInterval(MyMar)}//暂停移动
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//继续移动
}
function r_left(){if (dir=-1)dir=1}//换向左移
function r_right(){if (dir=1)dir=-1}//换向右移
var MyMar=setInterval(Marquee,speed)
</SCRIPT>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</td>
<td width=”11″><img id=”r_r” src=”static/image/common/panpanluo_button_r.gif”>
</td>
</tr>
</table></div>
4、前台DIY:前台DIY的时候将代码复制到自定义代码位置即可。 |
|
转载请注明:六特网 » DZ2.5首页向左滚动图片DIY