I have a script with loads up a lightbox and turns the background a semi transparent black. The only problem is that the black overlay seems to appear on top of the lightbox even thought its z-index is a lower number.
Can anyone suggest why this is happening?
Can anyone suggest why this is happening?
Code:
<div style="position: relative;"> <div id="light" style="display: none; position: absolute; top: -200px; width: 470px; height: 397px; padding: 0; background-color: transparent; z-index:1002; overflow: hidden; text-align: center;"> <a href=" javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"><img border="0" alt="Close" src="close.png" style="position: absolute; right: 20px;" /></a> <div style="width: 100%; padding-top: 16px;"> <script language="JavaScript" type="text/javascript" src="[I]javascript path[/I]"></script> <script language="JavaScript" type="text/javascript">[I]script[/I]</script> </div> <div id="fade" style="display: none; position: fixed; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80);"> </div> </div> </div> <p><a href="javascript:void(0)" onclick ="document.getElementById('fade').style.display='block'; document.getElementById('light').style.display='block';">[I]Click Here.[/I]</a></p>
Comment