XML/HTML代码
- <div class="roll_pic">
- <div class="roll_pic_Logo"><img src="http://icon.cnmo.com/tu/m1.jpg" /></div>
- <DIV id=demo style="FLOAT: none; OVERFLOW: hidden; WIDTH: 830px; HEIGHT: 150px">
- <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
- <TBODY>
- <TR>
- <TD id=demo1>
- <div class="roll_roll" style="width:1180px">
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/3965_1.html"><img src="http://imgm.cnmo.com/20_module_images/1782.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/3965_1.html">时尚手表手机V2</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/4057_1.html"><img src="http://imgm.cnmo.com/20_module_images/1804.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/4057_1.html">KM380对比W350</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/4065_1.html"><img src="http://imgm.cnmo.com/20_module_images/1806.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/4065_1.html">夏普 WILLCOM 03</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/3955_1.html"><img src="http://imgm.cnmo.com/20_module_images/1776.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/3955_1.html">LG KM380酷绚图赏</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/3955_1.html"><img src="http://imgm.cnmo.com/20_module_images/1776.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/3955_1.html">LG KM380酷绚图赏</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/3955_1.html"><img src="http://imgm.cnmo.com/20_module_images/1776.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/3955_1.html">LG KM380酷绚图赏</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/3955_1.html"><img src="http://imgm.cnmo.com/20_module_images/1776.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/3955_1.html">LG KM380酷绚图赏</a></div>
- </div>
- </div>
- <div class="hP">
- <div class="hPC">
- <a href="http://tu.cnmo.com/3955_1.html"><img src="http://imgm.cnmo.com/20_module_images/1776.jpg" width="140" height="105"/></a>
- <div class="hPCT"><a href="http://tu.cnmo.com/3955_1.html">LG KM380酷绚图赏</a></div>
- </div>
- </div>
- </div>
- </TD>
- <TD id=demo2></TD></TR></TBODY></TABLE></DIV>
- </div>
- <SCRIPT language=javascript>
- var speed=2;
- document.getElementById('demo2').innerHTML=document.getElementById('demo1').innerHTML;
- function Marquee(){
- if(document.getElementById('demo2').offsetWidth-document.getElementById('demo').scrollLeft<=0)
- document.getElementById('demo').scrollLeft-=document.getElementById('demo1').offsetWidth;
- else{
- document.getElementById('demo').scrollLeft++;
- }}
- var MyMar=setInterval(Marquee,speed);
- document.getElementById('demo').onmouseover=function() {
- clearInterval(MyMar);
- }
- document.getElementById('demo').onmouseout=function() {
- MyMar=setInterval(Marquee,speed);
- }</SCRIPT>
只要改下 CSS classname 还有width height
等就好了
几个示例网站
http://www.pconline.com.cn/coolshow/new/mobile/0804/1269236.html