左滚动- <div class="box">
- <div id="jsweb8_cn_right" style="overflow:hidden;width:740px;">
- <table cellpadding="0" cellspacing="0" border="0">
- <tr><td id="jsweb8_cn_right1" valign="top" align="center">
- <table cellpadding="4" cellspacing="0" border="0">
- {pc:content action="position" posid="12" thumb="1" order="listorder DESC" num="10"}
- <tr align="center">
- {loop $data $r}
- <td><div class="img-wrap">
- <a href="{$r[url]}" title="{$r[title]}"><img src="{thumb($r[thumb],180,160)}" title="{$r[title]}"/></a>
- </div>
- <a href="{$r[url]}" title="{$r[title]}">{str_cut($r[title],20)}</a></td>
- {/loop}
- </tr>
- {/pc}
- </table>
- </td>
- <td id="jsweb8_cn_right2" valign="top"></td>
- </tr>
- </table>
- </div>
- <script>
- var speed=10
- jsweb8_cn_right2.innerHTML=jsweb8_cn_right1.innerHTML;
- function Marquee4(){
- if(jsweb8_cn_right2.offsetWidth-jsweb8_cn_right.scrollLeft<=0)
- jsweb8_cn_right.scrollLeft-=jsweb8_cn_right2.offsetWidth;
- else{
- jsweb8_cn_right.scrollLeft++;
- }
- }
- var MyMar4=setInterval(Marquee4,speed);
- jsweb8_cn_right.onmouseover=function() {clearInterval(MyMar4);}
- jsweb8_cn_right.onmouseout=function() {MyMar4=setInterval(Marquee4,speed);}
- </script>
- </div>
复制代码 =====================
右滚动- <div class="box">
- <div id="jsweb8_cn_right" style="overflow:hidden;width:740px;">
- <table cellpadding="0" cellspacing="0" border="0">
- <tr><td id="jsweb8_cn_right1" valign="top" align="center">
- <table cellpadding="2" cellspacing="0" border="0">
- {pc:content action="position" posid="12" thumb="1" order="listorder DESC" num="10"}
- <tr align="center">
- {loop $data $r}
- <td><div class="img-wrap">
- <a href="{$r[url]}" title="{$r[title]}"><img src="{thumb($r[thumb],180,160)}" title="{$r[title]}"/></a>
- </div>
- <a href="{$r[url]}" title="{$r[title]}">{str_cut($r[title],20)}</a></td>
- {/loop}
- </tr>
- {/pc}
- </table>
- </td>
- <td id="jsweb8_cn_right2" valign="top"></td>
- </tr>
- </table>
- </div>
- <script>
- var speed=10
- jsweb8_cn_right2.innerHTML=jsweb8_cn_right1.innerHTML;
- function Marquee4(){
- if(jsweb8_cn_right.scrollLeft<=0)
- jsweb8_cn_right.scrollLeft+=jsweb8_cn_right2.offsetWidth;
- else{
- jsweb8_cn_right.scrollLeft--;
- }
- }
- var MyMar4=setInterval(Marquee4,speed);
- jsweb8_cn_right.onmouseover=function() {clearInterval(MyMar4);}
- jsweb8_cn_right.onmouseout=function() {MyMar4=setInterval(Marquee4,speed);}
- </script>
- </div>
复制代码 希望对你们有帮助
原贴地址:
http://bbs.phpcms.cn/forum.php?mod=viewthread&tid=730824 |
|