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

?帮忙看下代码有问题吗
按照书上的代码写上去的,效果是鼠标放在一个链接上显示出来一幅图片,怎么出不来效果,是代码有问题吗?
<form name=form1>
<a href="" name="link1" onMouseOver="ling1()">dfggdf</a>
<a href="" name="link2" onMouseOver="ling2()">dfgdfg</a>
<a href="" name="link3" onMouseOver="ling3()">dfgdfgdf</a>

<img name="img1" src="workmen.gif" width="200" height="200">
</form>
</body>
<script language=javascript>

function ling1()
{
document.form1.img1.src="workmen.gif"
}
function ling2()
{
document.form1.img2.src="ys5.gif"
}
function ling3()
{
document.form1.img3.src="apple.gif"
}

</script>

------解决方案--------------------
<form name=form1 > 
<a href="" name="link1" onMouseOver="ling1()" >dfggdf </a > 
<a href="" name="link2" onMouseOver="ling2()" >dfgdfg </a > 
<a href="" name="link3" onMouseOver="ling3()" >dfgdfgdf </a > 

<img name="img1" src="imgnr_12.jpg" width="200" height="200" > 
</form > 
</body > 
<script language=javascript > 

function ling1() 

document.form1.img1.src="imgnr_12.jpg" 

function ling2() 

document.form1.img1.src="imgzl_01.jpg" 

function ling3() 

document.form1.img1.src="title_bg.jpg" 


</script >

document.form1.img2.src
document.form1.img3.src
改成
document.form1.img1.src

------解决方案--------------------
是啊,哪来的img2,img3