1个回答
展开全部
给你找了一个 不要用非标准的属性和方法了 很麻烦
<script type="text/javascript">
document.write('<table align=center width=774 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');
document.write(' <tr> ');
document.write(' <td width=774 height=120 align=center class=border01 bgcolor=#FFFFFF>');
document.write(' <div id=demo style=overflow:hidden;width:750;align=center>');
document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');
document.write(' <tr>');
document.write(' <td valign=top bgcolor=ffffff id=marquePic1> ');
document.write(' <table width=90% border=0 cellspacing=0 cellpadding=0>');
document.write(' <tr align=center> ');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/1.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/2.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/4.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/5.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/6.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </td>');
document.write(' <td id=marquePic2 valign=top></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </div>');
document.write(' </td>');
document.write(' </tr>');
document.write(' </table>');
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>
<script type="text/javascript">
document.write('<table align=center width=774 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');
document.write(' <tr> ');
document.write(' <td width=774 height=120 align=center class=border01 bgcolor=#FFFFFF>');
document.write(' <div id=demo style=overflow:hidden;width:750;align=center>');
document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');
document.write(' <tr>');
document.write(' <td valign=top bgcolor=ffffff id=marquePic1> ');
document.write(' <table width=90% border=0 cellspacing=0 cellpadding=0>');
document.write(' <tr align=center> ');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/1.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/2.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/4.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/5.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' <td><a href="#" target="new"><img src=http://www.smallrain.net/jsimg/6.jpg width=150 height=100 hspace=2 border=0></a></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </td>');
document.write(' <td id=marquePic2 valign=top></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </div>');
document.write(' </td>');
document.write(' </tr>');
document.write(' </table>');
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>
参考资料: http://www.gowebcn.com/article.asp?id=137
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询