zoukankan      html  css  js  c++  java
  • Day10----------alphaPic

     //----------使用opacity属性完成对图片透明度渐变的效果
    1
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title></title> 6 </head> 7 <style type="text/css"> 8 img{height: 500px; 800px;margin: 20px 100px;filter:alpha(opacity:30);opacity: 0.3;} 9 </style> 10 <script type="text/javascript"> 11 window.onload=function(){ 12 var degree=0.3; 13 oImg=document.getElementsByTagName('img')[0]; 14 oImg.onmouseover=function(){ 15 setInterval(function(){ 16 degree+=0.05; 17 oImg.style.opacity=degree;//NIE; 18 oImg.style.filter="alpha(opacity:"+degree*100+")";//IE 19 },50); 20 } 21 } 22 </script> 23 <body> 24 <div><img src="pic/alpha.jpg"></div> 25 </body> 26 </html>
  • 相关阅读:
    5-5图层的链接-新版本不常用
    5-4图层的不透明度
    5-3图层的层次关系
    5-2图层的选择
    5-1图层初识
    RTP协议文章收藏
    NW.js桌面应用开发(一)
    WebRTC笔记(一)
    mediasoup-demo解析-客户端
    npx工具
  • 原文地址:https://www.cnblogs.com/fleshy/p/4132129.html
Copyright © 2011-2022 走看看