Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/10/2010, 08:07
Avatar de bitbow
bitbow
 
Fecha de Ingreso: julio-2006
Ubicación: Distrito Federal
Mensajes: 635
Antigüedad: 17 años, 9 meses
Puntos: 34
De acuerdo Respuesta: pop up misma ventana

Saludos nuevamente, en mi trabajo necesitaba hacer algo similar y me puse a buscar lo que necesitaba, en este mismo foro encontre este codigo, espero me disculpen por no poner el autor pero la verdad no lo recuerdo:

<html>
<head>
<meta http-equiv="content-type" content="text/html;" />
<meta name="author" content="alor86" />
<style type="text/css">
#fondo{ position:absolute; background: #000; left: 0; top: 0; width: 100%; height: 100%; opacity:0.15; filter:alpha(opacity="15");}
#msg{ position: absolute; background: #f0f0f0; top: 20%; left: 33%; width: 300px; height: 300px; border:groove 1px #000; }
.superior{ background: #0A3C7E; width: 100%; height: 30px; color: #fff; }
.cerrar { font-weight: bolder; cursor: pointer; font-family: arial; margin: 2px 5px; float: right; }
</style>
<title>CreaVentana</title>
<script type="text/javaScript">
var fondo = false;
var mensaje = false;
function creaVentana(){
fondo = document.createElement('div');
mensaje = document.createElement('div');
fondo.setAttribute('id','fondo');
mensaje.setAttribute('id','msg');
document.getElementsByTagName('body')[0].appendChild(fondo);
document.getElementsByTagName('body')[0].appendChild(mensaje);
mensaje.innerHTML="<div class='superior'><span class='cerrar' title='Cerrar' onclick='cerrar();'>X</span></div><p>aqui puedes meter el formulario</p>";
}
function cerrar(){
document.getElementsByTagName('body')[0].removeChild(fondo);
document.getElementsByTagName('body')[0].removeChild(mensaje);
fondo=false;
mensaje=false;
}
</script>
</head>

<body>
<input type="button" value="Crear ventana" onclick="creaVentana()"/>
</body>
</html>

Espero te sirva.
__________________
El ego es el mayor enemigo de un hombre inteligente.