El popup lo hago de la siguiente manera:
Código CSS:
Ver original<style>
#divBackground{
visibility:hidden;
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
display:none;
background-color:#000;
filter:alpha(opacity=60);
-moz-opacity:.6;
opacity:.6;
z-index:9;
}
#divPopup{
position:fixed;
top:50%;
left:50%;
margin-top:-81px;/* half of the height plus a little to the top */
margin-left:-150px;/* half of the width */
visibility:hidden;
display:none;
border:1px solid #000;
background-color:#FFF;
color:#333;
padding:0;
height:300px;
width:350px;
z-index:10;
font-size:12px;
}
#divPopupHead{
position:absolute;
top:0;
left:0;
width:100%;
background-color:#2B60DE;
color:#fff;
font-weight:bold;
padding:2px0;
z-index:-1;
}
#divClosePopup{
float:right;
text-align:right;
cursor:pointer;
padding-right:10px;
}
#divClosePopupa{
text-decoration:none;
color:#333;
}
#divClosePopupa:hover{
color:#FF0000;
}
#divPopupContent{
clear:both;
padding:10px;
}
</style>
el javascript
:
Código Javascript
:
Ver original<script language="javascript"type="text/javascript">
function showPopup(){
//Showpopup
document.getElementById('divBackground').style.visibility='visible';
document.getElementById('divPopup').style.visibility='visible';
document.getElementById('divBackground').style.display='block';
document.getElementById('divPopup').style.display='block';
}
function hidePopup() {
//Hidepopup
document.getElementById('divBackground').style.visibility='hidden';
document.getElementById('divPopup').style.visibility='hidden';
document.getElementById('divBackground').style.display='none';
document.getElementById('divPopup').style.display='none';
}
</script>
Código HTML:
Ver original<div id='divBackground'></div> <div id='divPopupHead'>titulo
</div> <div id='divClosePopup'onclick='hidePopup()'><a href='#'>X
</a></div> <div id='divPopupContent'> contenido
<a href='javascript:showPopup();'>Ver detalle
</a>