界面上有四个图片按钮(每个按钮对应不同的图片源),还有一个显示区域,
鼠标移动到其中一个按钮时自动在显示区域上显示图片。JS怎么实现?

解决方案 »

  1.   

    4个图片按钮 onmouseover 事件 。
    获得不同的图片源 。
    将显示区域里的img标签src改成图片源 。
      

  2.   


    <html> 
    <head> 
    <meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "> 
    <title> test </title> 
    <script type="text/javascript" src="jquery-1.4.min.js"></script>
    <script> 
    $(document).ready(function(){
    $("#ig1,#ig2,#ig3,#ig4").mousemove(function(){
    $("#ig5").attr({src:$(this).attr("src")});
    })
    });
    </script> 
    </head> 
    <body> 
    <input type="image" id="ig1" src="1.jpg" alt=""/>
    <input type="image" id="ig2" src="2.jpg" alt=""/>
    <input type="image" id="ig3" src="3.jpg" alt=""/>
    <input type="image" id="ig4" src="4.jpg" alt=""/>
    显示区域:
    <img id="ig5" src="" alt="" />
    </body> 
    </html> 
      

  3.   

    mousemove
    说错了 。见笑了 。