fancyBox3 触发 iframe

fancyBox3 trigger an iframe

在旧的 fancybox 版本中,我用这段代码打开了一个 iframe

$.fancybox({
                'padding':  20,
                'width':    '650px',
                'type':     'iframe',
                'href':     '....php?anchor=' + xyz,
                'autoDimensions': true,
                'autoScale': true,
                'centerOnScroll': true,
                'scrolling'     : 'no',
                afterClose : function(){
                    location.reload();
                }
            }); 

在新版本中是不可能的。 有什么想法吗?

看看docs/API就知道了。应该是这样的:

$.fancybox.open({
    src : 'https://codepen.io/',
    type : 'iframe',
    opts : {
        iframe : {
            css : {
                width: '500px'
            },
            attr : {
                scrolling : 'no'
            }
        },
        afterClose : function() {
            alert('done!');
        }
    }
});

演示 - https://codepen.io/anon/pen/BmbmJX?editors=1010