Java滤镜特效图片应用一例

在很多网站上常用到这种效果,图像开始很模糊,当把鼠标移动到上面时,图像又逐渐清晰了。有些是利用两张图片一张模糊,一张清晰交替出现。在视觉上有跳跃感,不如用Java滤镜的效果柔和。好了,下面我就用Java滤镜来实现这个效果。
   <html>
   <head>
   <title>图像效果</title>
   <script language=“JavaScript”>
   function high(image)//高亮显示
  
{
   theobject=image
   highlighting=setInterval(“highlightit(theobject)”,50)
  
}
   function low(image)//模糊显示
  
{
   clearInterval(highlighting)
   image.filters.alpha.opacity=20
  
}
   function highlightit(cur2)//改变图像光照效果
  
{
   if (cur2.filters.alpha.opacity<100)
   cur2.filters.alpha.opacity+=5
   else if (window.highlighting)
   clearInterval(highlighting)
  
}
   </script>
   </head>
   <body bgcolor=“#FFFFFF” text=“#000000”>
   <div align=“center”>
   <p><a href=#> <img border=“0” src=“*.gif” style=“filter:alpha(opacity=40)”
   onMouseover=“high(this)” onMouseout=“low(this)”></a> </p>
   <p>当鼠标移到模糊的图上,图像慢慢地变清晰,移走后,图又变模糊。</p>
   </div>
   </body>
   </html>