Jump to content

Opening a popup window making the background grey color


bindiya

Recommended Posts

I have a php page  with 5 menus.On clicking one of the enu i need to popup a window by making all the background in grey color .I have the javascript code for this,but the grey color is made only for the half of the page.Other half is not grey in color.How will i correct this?

the code  i paste here

 

<script type="text/javascript">

function showPopUp(el) {

var cvr = document.getElementById("cover")

var dlg = document.getElementById(el)

cvr.style.display = "block"

dlg.style.display = "block"

if (document.body.style.overflow = "hidden") {

cvr.style.width = "1024"

cvr.style.height = "100%"

}

}

function closePopUp(el) {

var cvr = document.getElementById("cover")

var dlg = document.getElementById(el)

cvr.style.display = "none"

dlg.style.display = "none"

document.body.style.overflowY = "scroll"

}

</script>

<style type="text/css">

#cover {

display:none;

position:absolute;

left:0px;

top:0px;

width:100%;

height:100%;

background:gray;

filter:alpha(Opacity=50);

opacity:0.5;

-moz-opacity:0.5;

-khtml-opacity:0.5

}

#dialog {

display:none;

left:200px;

top:200px;

width:300px;

height:300px;

position:absolute;

z-index:100;

background:white;

padding:2px;

font:10pt tahoma;

border:1px solid gray

}

</style>

</head>

<body>

<div id="cover"></div>

<div id="dialog">

You need to register with us to do the online payment.Click Ok to continue,Close to cancel.

<br><input type="text">

<br><a href='register.php'>OK</a>

<a href="1.html" onclick="closePopUp('dialog');">[Close]</a>

</div>

<a href="#" onclick="showPopUp('dialog');">Show</a>

 

Is there any jquery available for this?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.