【问题标题】:fancybox-3 open php pagefancybox-3 打开 php 页面
【发布时间】:2017-11-07 07:36:02
【问题描述】:

我使用的是版本 2,我想使用更新的版本进行更新。

大多数时候我使用它通过调用 PHP 页面在我的窗口中打开一个窗口。

请在下面找到我的 JS 函数来调用一个花哨的框 2:

function fancybox(url, modal, width, height, parameters, title, refresh) {

  $.fancybox({
    width: width,
    height: height,
    fitToView: false,
    autoSize: true,
    autoScale: false,
    transitionIn: 'none',
    transitionOut: 'none',
    type: 'iframe',
    beforeClose: function() {
        if (refresh !== undefined) {
            eval(refresh);
        }
    },
    href: url + '?' + parameters,
    modal: modal,
    title: title,
    helpers: {
        title: {
            position: 'top',
            type: 'inside'
        }
    }
});

现在我的调用JS有了这个功能:

fancybox('annonce-detail.php', false, 200, 200, 'nunati=' + 0504+ '&copaip=' + 0454+ '&objet=' + objet, undefined, 'refresh()');

今天我想让它进化以适应这个新版本。 问题是我不能用新版本做这种新功能。 请在下面找到我研究的开头:

$.fancybox.open({
    iframe : {
        tpl :url + '?' + parameters,
        css : {
               width: width,
               height: height
        }
}                           
});

我什至无法打开带有 php 页面的花式框

您能否告诉我我的请求是否可行,也许我可以使用您的一些帮助。

提前谢谢你,

【问题讨论】:

    标签: javascript php jquery fancybox-3


    【解决方案1】:

    您只需查看文档 - http://fancyapps.com/fancybox/3/docs/#api - 并遵循新语法:

    $.fancybox.open({
        src  : 'YOUR LINK',
        type : 'iframe',
        opts : {
            iframe : {
                css : {
                    width  : WIDTH,
                    height : HEIGHT,
                }
            },
            beforeClose : function( instance, current ) {
                console.info( 'closing!' );
            }
        }
    });
    

    顺便说一句,请不要在 GitHub 问题和此处重复

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-17
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多