例子,jquery弹出层背景半透明。
复制代码 代码示例:
jquery手写弹出层背景半透明,内容不透明*{ margin:0; padding:0;}
.alertDiv,.alertDiv1{ position:fixed; width:100%; height:100%; top:0; color:#fff;}
.alertCon,.alertCon1{ position:absolute; width:100%; height:100%; text-align:center; margin-top:20%; z-index:999;}
.alertBg,.alertBg1{ position:absolute; width:100%; height:100%; background:#000; opacity:0.7; z-index:99;}
.alertClose,.alertClose1{ position:absolute; width:100%; text-align:right; z-index:9999; color:#f00;}
/*By Lean*/
这里的内容是不透明的
/*By Lean*/
这里的内容是不透明的,这里的内容是另一个div的
$(function(){
/*By Lean*/
alertContent(".clickAlert",".alertDiv",".alertClose");
alertContent(".clickAlert1",".alertDiv1",".alertClose1");
function alertContent(LeanA,LeanB,LeanC){
$(LeanB).hide();
$(LeanA).click(function(){
$(LeanB).fadeIn(200);
})
$(LeanC).click(function(){
$(LeanB).fadeOut(200);
})
}
})
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容
Body内容