日期:2014-05-16  浏览次数:20379 次

帮忙看看这个JS
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <script id="clientEventHandlersJS" language="javascript">
  <!--
function StartImageMarquee()
{
var images_html="",i;
for(i=0;i<9;i++)
{
images_html+='<a href="http://www.google.com/"><img src="pic00'+(i+1)+'.png" border=0></a>';
}
image_marquee.innerHTML=images_html;
image_marquee.onmouseover=new function("image_marquee.scrollAmount=0;");
image_marquee.onmouseout=new function("image_marquee.scrollAmount=4;");

}
//-->
</script>

 </HEAD>

 <BODY onload="StartImageMarquee()">
 <MARQUEE id="image_marquee" scrollAmount="4" width="600"></MARQUEE>
  
 </BODY>
</HTML>
为什么老是提示对象找不到??


------解决方案--------------------
语法错误!
L@_@K
JScript code

image_marquee.onmouseover = function(){"image_marquee.scrollAmount=0;"}; 
image_marquee.onmouseout = function(){"image_marquee.scrollAmount=4;"};

------解决方案--------------------
更正
JScript code

image_marquee.onmouseover = function(){image_marquee.scrollAmount=0;}; 
image_marquee.onmouseout = function(){image_marquee.scrollAmount=4;};

------解决方案--------------------
原来的写法必须用大写!
JScript code

image_marquee.onmouseover = new Function("image_marquee.scrollAmount=0;"); 
image_marquee.onmouseout = new Function("image_marquee.scrollAmount=4;");