【问题标题】:fancyBox3 trigger an iframefancyBox3 触发一个 iframe
【发布时间】:2017-12-04 16:27:16
【问题描述】:

在旧的 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();
                }
            }); 

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

【问题讨论】:

    标签: jquery fancybox-3


    【解决方案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

    【讨论】:

    • 谢谢。我在几分钟前测试过它,但没有成功。但现在!对不起;-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-24
    • 2020-02-25
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    相关资源
    最近更新 更多