115S站长学院 TIY
编辑您的代码:
<html> <head> <style> img { filter:invert() } </style> <script type="text/javascript"> function getFilter() { document.getElementById('myImage').style.filter="invert()" } function noFilter() { document.getElementById('myImage').style.filter=false } </script> </head> <body> <p>本例演示如何动态地插入反转滤镜。</p> <b>请把鼠标移动到图像上:</b><br /> <img id="myImage" src="../i/eg_landscape.jpg" tppabs="http://zz.115s.com/i/eg_landscape.jpg" onmouseover="noFilter()" onmouseout="getFilter()" /> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?72e1eb95f3722bd737488ab37f422304"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>
查看结果: