js的图片滚动问题,只显示图片,但是不动
以下是代码,帮忙看看,谢了<div><scripttype="text/javascript">document.write('<tablealign=centerwid...
以下是代码,帮忙看看,谢了
<div>
<script type="text/javascript">
document.write('<table align=center width=800 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');
document.write(' <tr> ');
document.write(' <td width=800 height=120 align=center class=border01 bgcolor=#000000>');
document.write(' <div id=demo style=overflow:hidden;width:800;align=center>');
document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');
document.write(' <tr>');
document.write(' <td valign=top bgcolor=000000 id=marquePic1> ');
document.write(' <table width=90% border=0 cellspacing=0 cellpadding=0>');
document.write(' <tr align=center> ');
document.write(' <td ><a target="new"><img src=../joomla/images/stories/hwq.jpg hspace=2 border=0></a></td>');
document.write(' <td><a targetoo="new"><img src=../joomla/images/stories/srbb.gif 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=60;
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>
</div> 展开
<div>
<script type="text/javascript">
document.write('<table align=center width=800 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');
document.write(' <tr> ');
document.write(' <td width=800 height=120 align=center class=border01 bgcolor=#000000>');
document.write(' <div id=demo style=overflow:hidden;width:800;align=center>');
document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');
document.write(' <tr>');
document.write(' <td valign=top bgcolor=000000 id=marquePic1> ');
document.write(' <table width=90% border=0 cellspacing=0 cellpadding=0>');
document.write(' <tr align=center> ');
document.write(' <td ><a target="new"><img src=../joomla/images/stories/hwq.jpg hspace=2 border=0></a></td>');
document.write(' <td><a targetoo="new"><img src=../joomla/images/stories/srbb.gif 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=60;
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>
</div> 展开
1个回答
2009-05-20
展开全部
可能是1 你没有加载函数 2 没有用setTimeOut()调用
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询