opacity兼容写法

时间:2014-04-30 18:05:10   收藏:0   阅读:900
bubuko.com,布布扣
1 .opacity{
2     position: absolute;
3     top: 0px;left: 0px;
4     background: #000;
5     filter:alpha(opacity=50);       /* IE */
6     -moz-opacity:0.5;              /* 老版Mozilla */
7     -khtml-opacity:0.5;              /* 老版Safari */
8       opacity: 0.5;           /* 支持opacity的浏览器*/
9 }
bubuko.com,布布扣

 

Js写法

bubuko.com,布布扣
1 object.filter = "alpha(opacity=" + opacity + ")";  /* IE */
2 object.MozOpacity = (opacity / 100);           /* 老版Mozilla */
3 object.KhtmlOpacity = (opacity / 100);           /* 老版Safari */
4 object.opacity = (opacity / 100);           /* 支持opacity的浏览器*/
bubuko.com,布布扣

 

opacity兼容写法,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!