遮罩滤镜
- <html>
- <head>
- <style>
- div
- {
- position:absolute;
- left:10px;
- top:100px;
- width:160px;
- height:120px;
- }
- </style>
- <script type="text/javascript">
- function getFilter()
- {
- document.getElementById('myDiv').style.filter="mask(color=#ffffff)"
- }
- function noFilter()
- {
- document.getElementById('myDiv').style.filter=false
- }
- </script>
- </head>
-
- <body>
- <p>本例演示如何动态地插入遮罩滤镜。</p>
- <p>请把鼠标移动到图像上:</p>
- <div><img src="/i/eg_landscape.jpg" /></div>
- <div onmouseover="getFilter()" onmouseout="noFilter()" id="myDiv">
- <h1>Mouse over this image landscape</h1></div>
- </body>
- </html>