div的透明度设置
div的透明度属性为opacity:
#bg{
height:300px;
width:500px;
background-color:#60F;
opacity:0.5;}
动态控制div透明度
var bg = document.getElementByIdx_x('bg');
function changeBg(value){
bg.innerHTML= value.toString();
bg.style.opacity = value;
}