Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fancybox 2 Open Iframe version from code

I see this example : http://jsfiddle.net/STgGM/ on the FancyApps page, but I need to do similar, but with an iframe! When I replace the image path with a URL it does not do anything, no errors or anything.

$.fancybox.open([
{
    href : 'http://fancyapps.com/fancybox/demo/1_b.jpg',
    title : '1st title'
},
{
    href : 'http://fancyapps.com/fancybox/demo/2_b.jpg',
    title : '2nd title'
}    
], {
    padding : 0   
});

How can I modify this code to do show my url in an iframe.

I have also tried this variation:

$.fancybox({
    href: url,
    openEffect: 'none',
    closeEffect: 'none',
    width: 960,
    height: 540
});

Thanks, Jason

like image 572
box86rowh Avatar asked Nov 30 '22 01:11

box86rowh


1 Answers

Try using the 'type' option.

Example:

$.fancybox.open({
    padding : 0,
    href:'http://www.gamespot.com',
    type: 'iframe'
});

Fiddle: http://jsfiddle.net/STgGM/1329/

Docs: http://fancyapps.com/fancybox/#docs

like image 117
darshanags Avatar answered Dec 05 '22 18:12

darshanags