CSS 横向滚动广告

 1 <HTML><HEAD><TITLE>无标题文档</TITLE>
2 <META http-equiv=Content-Type content="text/html; charset=gb2312">
3 <META content="MSHTML 6.00.2800.1264" name=GENERATOR>
4 <link href="css/css.css" rel="stylesheet" type="text/css">
5 </HEAD>
6 <BODY leftMargin=0 topMargin=2 marginheight="0" marginwidth="0">
7 <CENTER>
8 <TABLE
9 style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid"
10 cellSpacing=0 cellPadding=0 width=750 align=center border=0>
11 <TBODY>
12 <TR>
13 <TD>
14 <DIV id=demo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">
15 <TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
16 <TBODY>
17 <TR>
18 <TD id=demo1 vAlign=top><table width="1710" height="116" border="0" cellpadding="0" cellspacing="0">
19 <tr>
20 <td width="171" background="images/pic_bg.jpg"><div align="center">1</div></td>
21 <td width="171" background="images/pic_bg.jpg"><div align="center">
22 <p>2</p>
23 </div></td>
24 <td width="171" background="images/pic_bg.jpg"><div align="center">3</div></td>
25 <td width="171" background="images/pic_bg.jpg"><div align="center">4</div></td>
26 <td width="171" background="images/pic_bg.jpg"><div align="center">5</div></td>
27 <td width="171" background="images/pic_bg.jpg"><div align="center">6</div></td>
28 <td width="171" background="images/pic_bg.jpg"><div align="center">7</div></td>
29 <td width="171" background="images/pic_bg.jpg"><div align="center">8</div></td>
30 <td width="171" background="images/pic_bg.jpg"><div align="center">9</div></td>
31 <td width="171" background="images/pic_bg.jpg"><div align="center">10</div></td>
32 </tr>
33 </table></TD>
34 <TD id=demo2 vAlign=top>&nbsp;</TD></TR></TBODY></TABLE></DIV>
35 <SCRIPT>
36 var speed3=25//速度数值越大速度越慢
37 demo2.innerHTML=demo1.innerHTML
38 function Marquee(){
39 if(demo2.offsetWidth-demo.scrollLeft<=0)
40 demo.scrollLeft-=demo1.offsetWidth
41 else{
42 demo.scrollLeft++
43 }
44 }
45 var MyMar=setInterval(Marquee,speed3)
46 demo.onmouseover=function() {clearInterval(MyMar)}
47 demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}
48 </SCRIPT>
49 </TD></TR></TBODY></TABLE></TD></TR></TABLE>
50 </CENTER>
51 </BODY></HTML>
posted @ 2012-02-09 16:50  一篮饭特稀  阅读(606)  评论(0编辑  收藏  举报