兼容ff和IE的div透明度设置,css代码和js代码
#AdLayer{

 

filter:alpha(opacity=30);
-moz-opacity: 0.6;
opacity: 0.6;
position:absolute;
width:61px;
height:59px;
z-index:20;
visibility:hidden;
left: 600px;
top:300px;
}
function run(){
if (navigator.appName.indexOf("Internet Explorer") == 10){
alert("IE浏览器:"+document.getElementById('div1').filters.alpha.Opacity);
}else{
alert("FF浏览器:"+document.getElementById('div1').style.opacity);
}
}

 

JS写法:
仅支持 FF
<script>document.getElementById("Layer1").style.opacity = "0.5";</script>

 

IE Only
<script>document.getElementById("Layer1").style.filter = "alpha(opacity=50)";</script>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2022-01-01
  • 2022-02-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-08-25
相关资源
相似解决方案