JavaScript实现鼠标滑过图片变换效果的方法

时间:2015-04-16    点击:79   

本文实例讲述了JavaScript实现鼠标滑过图片变换效果的方法。分享给大家供大家参考。具体如下:

<html>
<head>
<title>Swap Images with onMouseOver and onMouseOut</title>
</head>
<body bgcolor="#FFFFCC" text="#3300FF">
<CENTER>
<FORM NAME = form1>
<H2>
Move the mouse across to swap the image ...
</H2>
<A HREF="" name= link1 
onMouseOver = "ImgOver()" onMouseOut = "ImgOut()">
  <IMG NAME = "IMG1" 
  SRC = "images/follow.jpg" WIDTH = 800 HEIGHT = 600>
</A>
</CENTER>
<SCRIPT LANGUAGE= JavaScript>
function ImgOver()
{
 // use an image file you have or use one of XP's wallpaper
 document.form1.IMG1.src = 'images/home.jpg';
}
function ImgOut()
{
 // use an image file you have or use one of XP's wallpaper
 document.form1.IMG1.src = 'images/follow.jpg';
}
</SCRIPT>
</body>
</html>

希望本文所述对大家的javascript程序设计有所帮助。

JS中捕获console.log()输出的方法
JavaScript实现向setTimeout执行代码传递参数的方法
JavaScript通过setTimeout实时显示当前时间的方法
jQuery监控文本框事件并作相应处理的方法
JavaScript动态修改背景颜色的方法
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved