js脚本不执行
如下代码,js脚本不能执行,同样的代码,在一个页面用了两次高手指教!<divid="scroll"><divid="demo3"style="OVERFLOW:hidde...
如下代码,js脚本不能执行,同样的代码,在一个页面用了两次高手指教!
<div id="scroll">
<div id="demo3" style="OVERFLOW:hidden; width:495px; height:128px;">
<table cellspacing=0 cellpadding=0 align=center border=0 cellspace="0">
<tbody>
<tr>
<td id=marquePic3 valign=top><table border=0 align="center"
cellpadding=0 cellspacing=0>
<tbody>
<tr align=middle>
<td><img src="images/1.jpg" width="159" height="128" style="display:block; padding-left:8px;" /></td>
<td><img src="images/2.jpg" width="159" height="128" style="display:block; padding-left:8px;"/></td>
<td><img src="images/3.jpg" width="159" height="128" style="display:block; padding-left:8px;"/></td>
</tr>
</tbody>
</table></td>
<td id=marquePic4 valign=top></td>
</tr>
</tbody>
</table>
</div>
</div>
<SCRIPT language=Javascript>
<!--
var speed3=30;
var FG=document.getElementById('demo3');
var FG1=document.getElementById('marquePic3');
var FG2=document.getElementById('marquePic4');
FG2.innerHTML=FG1.innerHTML;
function Marquee3(){
if(FG.scrollLeft>=FG1.scrollWidth){
FG.scrollLeft=0;
}else{
FG.scrollLeft++;
}
}
var MyMar3=setInterval(Marquee3,speed3)
FG.onmouseover=function() {clearInterval(MyMar3)}
FG.onmouseout=function() {MyMar3=setInterval(Marquee3,speed3)
}
-->
</SCRIPT> 展开
<div id="scroll">
<div id="demo3" style="OVERFLOW:hidden; width:495px; height:128px;">
<table cellspacing=0 cellpadding=0 align=center border=0 cellspace="0">
<tbody>
<tr>
<td id=marquePic3 valign=top><table border=0 align="center"
cellpadding=0 cellspacing=0>
<tbody>
<tr align=middle>
<td><img src="images/1.jpg" width="159" height="128" style="display:block; padding-left:8px;" /></td>
<td><img src="images/2.jpg" width="159" height="128" style="display:block; padding-left:8px;"/></td>
<td><img src="images/3.jpg" width="159" height="128" style="display:block; padding-left:8px;"/></td>
</tr>
</tbody>
</table></td>
<td id=marquePic4 valign=top></td>
</tr>
</tbody>
</table>
</div>
</div>
<SCRIPT language=Javascript>
<!--
var speed3=30;
var FG=document.getElementById('demo3');
var FG1=document.getElementById('marquePic3');
var FG2=document.getElementById('marquePic4');
FG2.innerHTML=FG1.innerHTML;
function Marquee3(){
if(FG.scrollLeft>=FG1.scrollWidth){
FG.scrollLeft=0;
}else{
FG.scrollLeft++;
}
}
var MyMar3=setInterval(Marquee3,speed3)
FG.onmouseover=function() {clearInterval(MyMar3)}
FG.onmouseout=function() {MyMar3=setInterval(Marquee3,speed3)
}
-->
</SCRIPT> 展开
3个回答
展开全部
很简单:
把这句var MyMar3=setInterval(Marquee3,speed3)
改为:var MyMar3=setInterval("Marquee3()",speed3)
同理,把FG.onmouseout=function() {MyMar3=setInterval(Marquee3,speed3)
改为:FG.onmouseout=function() {MyMar3=setInterval(“Marquee3()",speed3)
祝你顺利!
把这句var MyMar3=setInterval(Marquee3,speed3)
改为:var MyMar3=setInterval("Marquee3()",speed3)
同理,把FG.onmouseout=function() {MyMar3=setInterval(Marquee3,speed3)
改为:FG.onmouseout=function() {MyMar3=setInterval(“Marquee3()",speed3)
祝你顺利!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询