Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/01/2010, 00:01
Avatar de alor86
alor86
 
Fecha de Ingreso: abril-2009
Mensajes: 110
Antigüedad: 15 años
Puntos: 5
Respuesta: Ayuda con ventana

prueba con esto
Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2.  
  3.     <head>
  4.         <script type="text/javascript">
  5.             window.onload = function(){
  6.                 var cl = document.getElementById('cl');
  7.                 cl.onclick = function(){
  8.                         var fondo = document.getElementById('superior');
  9.                         var ventana = document.getElementById('ventana');
  10.                         document.getElementsByTagName('body')[0].removeChild(fondo);
  11.                         document.getElementsByTagName('body')[0].removeChild(ventana);
  12.                 }              
  13.             }
  14.         </script>
  15.          <style type="text/css">
  16.                 div.cont{
  17.                     width: 700px;
  18.                     height: 600px;
  19.                     border: solid 1px black;
  20.                     background: yellow;
  21.                     margin: 10px auto 10px auto;
  22.                 }
  23.                 #superior{
  24.                     position: absolute;
  25.                     z-index: 1000;
  26.                     background: #000;
  27.                     filter:alpha(opacity='70');
  28.                     opacity:0.7;
  29.                     width: 100%;
  30.                     height: 100%;
  31.                     top: 0;
  32.                     left: 0;
  33.                 }
  34.                 #ventana{
  35.                     position: absolute;
  36.                     width: 400px;
  37.                     height: 400px;
  38.                     top: 30%;
  39.                     left: 30%;
  40.                     z-index: 1001;
  41.                     background: #fff;
  42.                    
  43.                 }
  44.                 div.titulo{
  45.                     height: 30px;
  46.                     background: #8800ff;
  47.                     text-align: right;
  48.                 }
  49.                 div.titulo span{
  50.                     cursor: pointer;
  51.                 }
  52.          </style>
  53.          
  54.     </head>
  55.    
  56.     <body>
  57.         <div id="superior">
  58.            
  59.         </div>
  60.         <div id="ventana">
  61.             <div class="titulo">
  62.                 <span id="cl">X &nbsp;</span>
  63.             </div>         
  64.         </div>
  65.         <div id="contenido" class="cont">
  66.            
  67.         </div>  
  68.     </body>
  69. </html>