Forum Moderators: open
Below is the entire script:
<html>
<head>
<script type="text/javascript">
function ShowPopUp( DivPopUpID, DivMainID )
{
var DivMain = document.getElementById(DivMainID);
if ( DivMain != null )
{
DivMain.disabled = true;
}
var DivPopUp = document.getElementById(DivPopUpID);
if ( DivPopUp != null )
{
DivPopUp.style.display = "block";
}
}
function HidePopUp( DivPopUpID, DivMainID )
{
var DivMain = document.getElementById(DivMainID);
if ( DivMain != null )
{
DivMain.style.display = "block";
DivMain.disabled = false;
}
var DivPopUp = document.getElementById(DivPopUpID);
if ( DivPopUp != null )
{
DivPopUp.style.display = "none";
}
}
</script>
</head>
<body>
<div id="DivMain">
<a href="#" onclick="ShowPopUp('DivLogin', 'DivMain'); return false;">Click Show</a>
<br />
<a href="#" onclick="HidePopUp('DivLogin', 'DivMain'); return false;">Click Hide</a>
</div>
<div id="DivLogin" style="border-right: blue 4px double; padding-right: 1px; border-top: blue 4px double; display: none; padding-left: 1px; font-size: 10pt; left: 25%; visibility: visible; padding-bottom: 1px; margin: 1px; vertical-align: baseline; border-left: blue 4px double; width: 300; padding-top: 1px; border-bottom: blue 4px double; font-family: Tahoma; position: absolute; top: 30%; height: 100px; background-color: #ffffff; text-align: center">
<div style="text-align: left" align="center">
Content inside the popup goes here...
</div>
</div>
</body>
</html>
document.body.onclick = function() {
......
}
See if that doesn't help.
You might also want to have one function called, perhaps, changePopup that does both the hiding and the showing by checking to see which status it is currently in and does the opposite. That way you can just add that right into the body onclick function.
... and Welcome to WebmasterWorld!
Pretty confusing, huh? :)
If you want to define it directly in the body tag, try this instead:
<body onclick="HidePopUp(DivPopUpID, DivMainID);">