2012-01-26 41 views
5

He buscado algunos ejemplos en línea, pero no pude financiar ninguno.Abrir página html dentro de fancybox

¿cómo puedo cargar un nuevo html dentro de fancybox?

$('#Create').click(function() { 
$.fancybox({ 

What should be the content over here? 
(lets say i want to load stackoverflow.com) 

}); 

Respuesta

11

La documentación está justo en el sitio, se puede utilizar un iframe:

$("#iframe").fancybox({ 
    'width'   : '75%', 
    'height'  : '75%', 
    'autoScale'  : false, 
    'transitionIn' : 'none', 
    'transitionOut' : 'none', 
    'type'   : 'iframe' 
}); 

HTML

<a href="http://www.example?iframe">This goes to iframe</a> 

or 

<a id="iframe" href="http://www.example">This goes to iframe</a> 

Puede encontrar toda la información que aquí: http://fancybox.net/howto

Cuestiones relacionadas