http://www.cctvhw.com/products.php
就像这个网页上的效果一样。
谢谢。
<marquee> 默认 </marquee>
<marquee direction='right'> 向右 向左left 向上up 向下 down </marquee>
<marquee direction='left' onmouseover='stop()'onmouseout='start()'> 鼠标移动停止 </marquee>
<marquee bgcolor='#dddddd' width='300' height='50'> 背景颜色 宽 高 </marquee>
<marquee Behavior='alternate'> 来回滚动顾 scroll 端滚动到另一端 slide 一端快速滑动到另一端,且不再重复 </marquee>
<marquee Scrollamount='100'> 滚动速度 </marquee>
<marquee Loop='3'> 滚动次数 -1无限循环 </marquee>
<marquee direction='left' onmouseover='stop()'onmouseout='start()'> <img src=' http://www.google.cn/images/nav_logo7.png'/>
<img src=' http://www.google.cn/images/nav_logo7.png'/> </marquee>
<div onmouseover='stopscroll();' onmouseout='doscroll()'><div ><!--图片地址这里填,可以多张--></div></div>
这程序也有缺点.你自己测试一下就知道了,最好自己写个判断语句来结合
上面的方法可以实现
再给一个用JS来实现的,用到jquery库
http://bbs.jquery.org.cn/simple/index.php?t4495.html
<!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> <title>网页设计秀</title> <style type="text/css"> <!-- TD {FONT-SIZE: 12px;} </style> </head>
<body> <div id=demo > <table cellspacing="0" cellpadding="0" align="center" border="0"> <tbody> <tr> <td id="marquePic1" valign="top"> <table width="958" height="130" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="95" height="110" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="95" align="center"><img src="" /></td> <td width="103" align="center"><img src="" /></td> </tr> </table> </td> <td id="marquePic2" valign="top"></td> </tr> </tbody> </table> </div> <script type=text/javascript> var speed=30 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>