改变图像的来源和尺寸

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function moveover()
  5. {
  6. document.getElementById('image').src="/i/eg_bulbon.gif"
  7. document.getElementById('image').width="100"
  8. document.getElementById('image').height="180"
  9. }
  10. function moveback()
  11. {
  12. document.getElementById('image').src="/i/eg_landscape.jpg"
  13. document.getElementById('image').width="160"
  14. document.getElementById('image').height="120"
  15. }
  16. </script>
  17. </head>
  18.  
  19. <body>
  20.  
  21. <b>请把鼠标移动到图像上:</b><br />
  22. <img id="image" src="/i/eg_landscape.jpg"
  23. onmouseover="moveover()"
  24. onmouseout="moveback()" width="160" height="120" />
  25.  
  26. </body>
  27. </html>
  28.  
  29.