Connecting Tech Pros Worldwide Forums | Help | Site Map

How to stop popup being transparent

Newbie
 
Join Date: Sep 2009
Posts: 1
#1: Sep 4 '09
Hi,

For some reason my onclick/off click pop up window is see through and the text underneath can still be viewed, which makes reading the popup difficult. Can anyone helpP This is my javascript:

Expand|Select|Wrap|Line Numbers
  1. <script language="Javascript">
  2. function ShowPop(id)
  3.     document.getElementById(id).style.visibility = "visible";
  4. }
  5. function HidePop(id)
  6. {
  7.      document.getElementById(id).style.visibility = "hidden";
  8. }
  9. </script>
And my HTML:

Expand|Select|Wrap|Line Numbers
  1. <span style="position:relative;">
  2. <span id="termName" class="popup">
  3. <p>Blah
  4. <p>Level: 1
  5. <p>Points: 40>
  6. </span><a href="javascript:void(0);" onMouseover="ShowPop('termName');" onMouseout="HidePop('termName');">Blah</a></span>
And the CSS

Expand|Select|Wrap|Line Numbers
  1. .popup
  2. {
  3.    position:absolute; left:10; top:30; width:390; height:220;
  4.  
  5.    border-style:solid;
  6.    border-width:0;
  7.    border-color:white;
  8.    background-image: url(images/usercard.gif); 
  9.    padding:5px;
  10.    color:black;
  11.    visibility:hidden;
  12.    z-index:2;
  13. }
Thanks in advance
Hannah

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,684
#2: Sep 4 '09

re: How to stop popup being transparent


I’m not entirely sure whether that’s the reason, but <p> is not allowed inside <span>.
Reply