W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <style> img { filter:opacity(10%); } </style> <script type="text/javascript"> alpha = 50; function setImageAlpha(){ document.getElementById('myImage').style.WebkitFilter = 'opacity(' + alpha + '%)'; } function clean() { interval=setInterval("makeclean(myImage)",10) } function foggy() { clearInterval(interval) alpha=10; setImageAlpha(); } function makeclean() { if (alpha < 100) { alpha += 5; setImageAlpha(); } else if (window.interval) { clearInterval(interval) } } </script> </head> <body> <b>请把鼠标移动到图像链接上:</b><br /> <a href="/index.html" target="_blank"> <img border="0" id="myImage" src="/i/eg_smile.gif" onmouseover="clean()" onmouseout="foggy()" /> </a> </body> </html>