在mouseover 和mouseout事件中分别修改图片的 src 就可以了。

解决方案 »

  1.   

    代码不全啊~~~
    把HTML贴出来就行了
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
      <title> new document </title>
     </head>
    <script>
    var ins = ["iwode/shopPic/1.jpg","iwode/shopPic/2.jpg"];
    var outs = ["iwode/shopPic/3.jpg","iwode/shopPic/4.jpg"];
    function inHandler(n,id){
    if(id==2){
    document.getElementById("div2").style.display = '';
    }
    document.getElementById("img"+id).src = ins[n];
    }
    function outHandler(n,id){
    if(id==2){
    document.getElementById("div2").style.display = 'none';
    }
    document.getElementById("img"+id).src = outs[n];
    }
    </script>
    <body>
    <img src="iwode/shopPic/3.jpg" id="img1" onmouseover="inHandler(0,1)" onmouseout="outHandler(0,1)" />
    <img src="iwode/shopPic/4.jpg" id="img2" onmouseover="inHandler(1,2)" onmouseout="outHandler(1,2)" />
    <div id="div2" style="height:200px; width:300px; border:1px solid #00C; display:none; position:absolute; left:1000px; top:500px;"></div>
    </body>
    </html>