<html>
<head>
<script src="jqueryv1.10.2.js"></script>
<script>
$(document).ready(function()
{
$("#wings").click(function(event)
{
loadPopupBox();
$("body").css("background","lightgray","opacity","0.4","filter","alpha(opacity=40)");
});
$("#popupclose").click(function(event)
{
unloadPopupBox();
$("body").css("background","#FFF");
});
function loadPopupBox()
{
$("#popupbox").fadeIn("slow");
}
function unloadPopupBox()
{
$("#popupbox").fadeOut("normal");
}
$("#popupbox").hide();
});
</script>
<style>
#wings { margin-top:100px; margin-left:550px; font:bold 13px sans-serif; background:orange;
float:left; padding:6px; }
#popupbox { position:fixed; _position:absolute; /*hack for IE6*/ background:#FFF; left:472px;
top:150px; border:2px solid lightgray; padding:15px; z-index:100px;
font-size:15px; -moz-box-shadow: 0px 0px 5px lightgray; -webkit-box-shadow:0px 0px 5px lightgray;
box-shadow:0px 0px 5px lightgray; }
#popupclose { border:0px solid lightgray; color:#6FA5E2; font-family:sans-serif; font-weight:bold;
line-height:15px; float:right; cursor:pointer; text-decoration:none; }
</style>
</head>
<body>
<div id="wings"> Click Me</div>
<div id="popupbox">
<!--div style="height:30px;"><a id="popupclose">Close</a></div>-->
<!--or-->
<div style="height:30px;"><img id="popupclose" src="close.png" style="float:right;"/></div>
<table>
<tr><td>USERNAME : </td><td><input type="text" size="30%"></td></tr>
<tr><td>PASSWORD : </td><td><input type="password" size="30%"></td></tr>
<tr><td><input type="submit" value="LOGIN"></td></tr>
</table>
</div>
</body>
</html>
我想要一個身體背景的不透明度:當我打開彈出窗口時,身體背景不透明度應該是透明的。任何人都可以建議設置在jQuery本身的不透明度JQuery Popup Opacity
如果你需要像這樣做多個CSS:'.css({「background」:「lightgray」,「opacity」:「0.4」,「filter」:「alpha(opacity = 40)」}) ' – Pete
謝謝你皮特,如果我像你說的添加CSS,彈出框和身體背景正在改變lightcolor,但我需要身體背景 – ronquiq
是啊,如果你應用不透明的身體,它會級聯一個d也將它應用到所有身體的孩子 – Pete