渐变显示图像
- <html>
- <head>
- <style>
- img
- {
- filter:alpha(opacity=10)
- }
- </style>
- <script type="text/javascript">
- function clean()
- {
- interval=setInterval("makeclean(myImage)",10)
- }
-
- function foggy()
- {
- clearInterval(interval)
- document.getElementById('myImage').filters.alpha.opacity=10
- }
-
- function makeclean()
- {
- if (document.getElementById('myImage').filters.alpha.opacity<100)
- {
- document.getElementById('myImage').filters.alpha.opacity+=5
- }
- else if (window.interval)
- {
- clearInterval(interval)
- }
- }
- </script>
- </head>
-
- <body>
- <img id="myImage" src="/i/eg_landscape.jpg" onmouseover="clean()" onmouseout="foggy()" />
- <b>请把鼠标移动到这个图像上</b>
- </body>
- </html>