setOpcity()

 1 var oWrap = document.getElementById("wrap");
 2         function setOpacity(node, level){
 3             node = typeof node === "string" ? document.getElementById(node) : node;
 4             if(!document.all){
 5                 node.style.opacity = level/100;
 6             }else{
 7                 node.style.filter = 'alpha(opacity='+ level +')';
 8             }
 9         }
10         setOpacity(oWrap, 80);

IE用得是滤镜,其他设置opacity属性

posted @ 2013-10-24 14:02  楚玉  阅读(191)  评论(0编辑  收藏  举报