Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/06/2011, 18:41
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 1 mes
Puntos: 192
Respuesta: FancyBox IFRAME

Esto funciona aunque me parece un tanto rebuscado.

index.php

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5.     <title>FancyBox 1.3.4 | Demonstration</title>
  6.     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  7.     <script type="text/javascript" src="./fancybox/jquery.fancybox-1.3.4.pack.js"></script>
  8.     <link rel="stylesheet" type="text/css" href="./fancybox/jquery.fancybox-1.3.4.css" media="screen" />
  9.     <link rel="stylesheet" href="style.css" />
  10.     <script type="text/javascript">
  11.         $(document).ready(function() {
  12.             $("#ejemplo").fancybox({
  13.                 'width'         : '20%',
  14.                 'height'            : '20%',
  15.                 'autoScale'     : false,
  16.                 'transitionIn'      : 'none',
  17.                 'transitionOut' : 'none',
  18.                 'type'          : 'iframe'
  19.             });
  20.         });
  21.     </script>
  22. </head>
  23. <body>
  24. <div id="content">
  25.     <p><a id="ejemplo" href="form.php">Cargar datos</a></p>
  26.     <p>Datos: <?php echo $_REQUEST['datos']?></p>
  27. </div>
  28. </body>
  29. </html>

form.php

Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <script>
  4. function enviar_datos(form){
  5.     var datos = form.datos.value;
  6.     parent.document.location = 'index.php?datos=' + datos;
  7.     parent.$.fancybox.close();
  8. }
  9. </script>
  10. </head>
  11. <body>
  12. <form action="#" onsubmit="enviar_datos(this)">
  13. <p><input type="text" name="datos" id="datos" /></p>
  14. <p><input type="submit" /></p>
  15. </form>
  16. </body>
  17. </html>


-edit-

Me olvidé de mencionar que para este ejemplo sería necesario asegurarse que los datos pasados estén con los caracteres escapados para que se envíen correctamente.
__________________
nahueljose.com.ar