日期:2014-05-17  浏览次数:20863 次

点击更换图片的问题
单击图片的某一部分,变成原位置大小不变的另一幅图片
<map   name= "Map2 ">
    <area   shape= "rect "   coords= "4,6,94,32 "   href= "# "   target= "_self "   onClick= "javascript:goto1(); ">
<area   shape= "rect "   coords= "99,5,188,33 "   href= "cpzsdetail1.asp "   target= "_self "   onClick= "javascript:goto2(); "> </map>

function       goto1()      
    {      
  <img   src= "images/y1.jpg "   width= "581 "   height= "42 "   border= "0 "   usemap= "#Map2 ">
    }    
        function       goto2()      
    {      
  <img   src= "images/y2.jpg "   width= "581 "   height= "42 "   border= "0 "   usemap= "#Map2 ">
    }    
          </script>

上边是我写的,是不是不该用function   该如何修改呢?

非常感谢

------解决方案--------------------
<img src= "1.jpg " onclick= "this.src= '2.jpg ' ">