<html> |
<head> |
<meta http-equiv= "Content-Type" content= "text/html; charset=gb2312" > |
<title>鼠标感应:渐显图片</title> |
</head> |
<body> |
<center> |
<h1>鼠标感应:渐显图片</h1> |
<hr> |
<!--显示一个超级链接,其onMouseOver事件调用相应的事件处理函数--> |
<a href= "" name=link1 onMouseOver= "link1Over()" >鼠标移动至这里显示图片</a><br> |
<!--显示一幅空图片,其清晰度为0,并有onMouseOver和onMouseOut调用相应函数--> |
<img name= "img1" src= "7_3.jpg" style= "filter:alpha(opacity=0)" |
onMouseOver= "makevisible(this,0)" |
onMouseOut= "makevisible(this,1)" > |
<script language= "JavaScript" > |
<!-- |
function link1Over() //函数:显示图像 |
{ //链接一的鼠标事件:替换图像 |
document.img1.src= "7_3.jpg" //要显示的图像 |
document.img1.filters.alpha.opacity=20 //图像清晰度20% |
} |
function makevisible(cur,a) //图像清晰度切换 |
{ |
if (a==0) { |
cur.filters.alpha.opacity=100 //清晰度变为100% |
} |
else { |
cur.filters.alpha.opacity=20 //清晰度变为20% |
} |
} |
//--> |
</script> |
</center> |
</body> |
</html> |