2

在旧的 fancyboxversion 中,我使用此代码打开一个 iframe

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

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

4

1 回答 1

1

只需看一下文档/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

于 2017-12-04T16:40:26.227 回答