码迷,mamicode.com
首页 > 其他好文 > 详细

不间断滚动

时间:2015-06-17 16:35:32      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片不间断向左滚动JS代码</title>
<style>
#demo{width:728px; overflow:hidden; margin:0px auto}</style>
</head>
<body>
<div id="demo">
    <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >
        <tr><td valign=top bgcolor=ffffff id=marquePic1>
    <table width=‘100%‘ border=‘0‘ cellspacing=‘0‘><tr>
<td align=center><a href=‘http://www.16sucai.com‘><img src="images/01.jpg" width=232 height=139 border=0><br><br>01</a></td>
<td align=center><a href=‘http://www.16sucai.com‘><img src="images/02.jpg" width=232 height=139 border=0><br><br>02</a></td>
<td align=center><a href=‘http://www.16sucai.com‘><img src="images/03.jpg" width=232 height=139 border=0><br><br>03</a></td>
<td align=center><a href=‘http://www.16sucai.com‘><img src="images/04.jpg" width=232 height=139 border=0><br><br>04</a></td>
<td align=center><a href=‘http://www.16sucai.com‘><img src="images/05.jpg" width=232 height=139 border=0><br><br>05</a></td>
</tr></table>
        </td><td id=marquePic2 valign=top></td></tr>
    </table></div>
    <div style="height:90px; width:728px; padding-top:10px; margin:0px auto;">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-6110696270771103";
/* 全站大横幅 */
google_ad_slot = "4968847295";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script> <script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<script type="text/javascript">
var speed=50 
marquePic2.innerHTML=marquePic1.innerHTML 
function Marquee(){ 
if(demo.scrollLeft>=marquePic1.scrollWidth){ 
demo.scrollLeft=0 
}else{ 
demo.scrollLeft++ 
} 
} 
var MyMar=setInterval(Marquee,speed) 
demo.onmouseover=function() {clearInterval(MyMar)} 
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} 
</script>

</body>
</html>

 

不间断滚动

标签:

原文地址:http://www.cnblogs.com/zywf/p/4583648.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!