2018-10-10

2018-11-20  本文已影响0人  熊熊熊熊丽

一、透明度:

opacity:0.3;   //ff chrom 高级浏览器
filter:alpha(opacity=30); //IE

设置透明度的时候也是具有兼容性的:

二、获取行间样式:

obj.style.属性
obj.style[属性]

三、获取非行间样式:(具有兼容性)

getComputedStyle(obj,null)[属性] // chrome
obj.currentStyle(属性)        //IE

四、document.all 获取页面所有元素的集合。

在IE返回的是true,其他浏览器返回的是false。

  function getStyle(obj,style){
    if(obj.currentStyle){
    return obj.currentStyle[style];
    }else{
    return getComputedStyle(obj,null)[style];
    }
   }
上一篇 下一篇

猜你喜欢

热点阅读