使用Js的对象属性能实现简单的翻转效果。通过onMouseover事件和onMouseOut事件就能实现鼠标移到链接上和移开链接发生反应。给两个图片加上链接实现都能翻转的效果。

  reverse.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>图片翻转Demo</title>
<style type="text/css">
h1{color:yellow;
text-align:center;}

</style>
</head>
<body>
<h1>实现图片翻转</h1>
<img src="smile.jpg" name="smileimage"
onMouseOver="window.document.smileimage.src='smilereverse.jpg';"
onMouseOut="window.document.smileimage.src='smile.jpg';"
>
<br>
<p>
<a href="#" 
onMouseOver="window.document.smileimage.src='smilereverse.jpg';"
onMouseOut="window.document.smileimage.src='smile.jpg';"
><img src="submit.png" name="turn" border="0" width="298" height="68"></a>
</p>
</body>
</html>

  

相关文章:

  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案