一褐耳、透明度:
opacity:0.3; //ff chrom 高級(jí)瀏覽器
filter:alpha(opacity=30); //IE
設(shè)置透明度的時(shí)候也是具有兼容性的:
二沪停、獲取行間樣式:
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];
}
}