当前位置: 代码迷 >> Web前端 >> jquery半透明设立
  详细解决方案

jquery半透明设立

热度:119   发布时间:2012-11-23 22:54:33.0
jquery半透明设置

function setOpacity(eles){
$(eles).each(function(){
if($.browser.msie){
$(this).clone().empty().insertAfter($(this))
.css({"position":"relative","top":-$(this).height()})
.css("z-index",-1).addClass("opacityBgInIE");

$(this).css("background","transparent");

$(this).find('.panel-header,.panel-body').css("background","transparent");
}else{
$(this).addClass("opacitysetting");

$(this).find('.panel-header,.panel-body').css("background","none");
}
});
}

使用方式如下:

//实现半透明效果
setOpacity("#mainpartopacity,#contents,#frameAccordionMenu");

  相关解决方案