Here is my code, but still i am not getting an ouput what i expect.
<head>
<script>
function overlay()
{
$("body").css ({
"background" : "#fff",
"z-index" : "999",
"opacity" : "0.50",
"position" : "relative",
});
$("#popupContact").css ({
"position" : "relative",
"z-index" : "999",
"opacity" : "1"
});
}
</script>
</head>
<body>
<div id="popupContact">
<h1>Sample Test</h1>
</div>
<a onclick="return overlay();">Click to view</a>
</body>
If i click on that <a> , a popup window will be open , in that time i want to show popup division as highlighted and body should be dim..
Any useful answer will be really appreciate..
Thanks in advance.
the problem is your child div
popupContactis inheritingbodyopacitySo one of the possible workarounds is to use this instead of
background:#fffuse this
background-color: rgba(0,0,0,0.5);Here is a link for the fiddle
http://jsfiddle.net/XFn67/