//设置透明度
function setOpacity(node,level){ node=typeof node=="string"?document.getElementById(node):node; if(document.all){ node.style.filter='alpha(opacity='+level+')'; }else{ node.style.opacity=level/100; } } //阻止冒泡 function stopPropagation(e){ e=window.event||e; if(document.all){ e.cancelBubble=true; }else{ e.stopPropagation(); } } //使用attachEvent和addEventListener代替on xxx function on(node,eventType,handler){ node=typeof node=="string"?document.getElementById(node):node; if(document.all){ node.attachEvent("on"+eventType,handler); }else{ node.addEventListener(eventType,handler,false); } }