【问题标题】:Fancybox iframe close button not hidden when showCloseButton is set to 'false'当 showCloseButton 设置为“false”时,Fancybox iframe 关闭按钮不隐藏
【发布时间】:2011-12-10 10:20:06
【问题描述】:

我正在使用 Fancybox 1.3.4 和 jQuery 1.6.2

当我调用以下fancybox 函数在iframe 中加载html 页面时,一切正常,并且没有错误:

$.fancybox({
    'width'             : '75%',
    'height'            : '75%',
    'autoScale'         : false,
    'transitionIn'      : 'none',
    'transitionOut'     : 'none',
    'type'              : 'iframe',
    'href'              : 'search.htm'
});



当我添加 showCloseButton 选项时,一切正常,并且没有错误 BUT 仍然显示关闭按钮:

$.fancybox({
    'width'             : '75%',
    'height'            : '75%',
    'autoScale'         : false,
    'transitionIn'      : 'none',
    'transitionOut'     : 'none',
    'type'              : 'iframe',
    'href'              : 'search.htm',
    'showCloseButton'   : 'false'
});

我怎样才能摆脱角落盒子?

【问题讨论】:

    标签: jquery jquery-plugins user-interface iframe fancybox


    【解决方案1】:

    糟糕,StackOverflow 语法高亮一出现就发现了问题。 false 没有引号

    $.fancybox({
        'width'             : '75%',
        'height'            : '75%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe',
        'href'              : 'search.htm',
        'showCloseButton'   : false
    });
    

    【讨论】:

      【解决方案2】:

      试试这个:

         showCloseButton:'hide'
      

      【讨论】:

        【解决方案3】:

        尽管遵循 Google 中作为第一个结果出现的文档,我还是遇到了这个问题。

        原来 API 已更改,文档已过时。请参阅 v2 文档: http://fancyapps.com/fancybox/#docs


        改用closeBtn 属性:

        jQuery.fancybox({
            closeBtn: false
        });
        

        【讨论】:

          猜你喜欢
          • 2023-03-08
          • 1970-01-01
          • 2020-08-05
          • 1970-01-01
          • 1970-01-01
          • 2011-01-02
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多