【问题标题】:Jquery fancybox problemjQuery花式框问题
【发布时间】:2011-05-08 22:22:09
【问题描述】:

我在使用 jquery fancybox 时遇到问题。我在fancybox 中显示一个表格。使用 iframe。当我单击弹出窗口上的任何位置时,它正在关闭。如果单击文本框/文本区域,它正在关闭。我希望它仅在我单击关闭按钮或提交表单按钮时关闭。有什么帮助吗?

链接-

<a href="{$this_path}productquestion-form.php?id_product={$smarty.get.id_product|intval}&content_only=1&TB_iframe=true&width=570&height=635&thickbox=true" class="thickbox">

fancybox 的选项设置为默认值。

$.fn.fancybox.defaults = {
        padding : 10,
        margin : 40,
        opacity : false,
        modal : false,
        cyclic : false,
        scrolling : 'auto', // 'auto', 'yes' or 'no'

        width : 560,
        height : 340,

        autoScale : true,
        autoDimensions : true,
        centerOnScroll : false,

        ajax : {},
        swf : { wmode: 'transparent' },

        hideOnOverlayClick : true,
        hideOnContentClick : false,

        overlayShow : true,
        overlayOpacity : 0.7,
        overlayColor : '#777',

        titleShow : true,
        titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
        titleFormat : null,
        titleFromAlt : false,

        transitionIn : 'fade', // 'elastic', 'fade' or 'none'
        transitionOut : 'fade', // 'elastic', 'fade' or 'none'

        speedIn : 300,
        speedOut : 300,

        changeSpeed : 300,
        changeFade : 'fast',

        easingIn : 'swing',
        easingOut : 'swing',

        showCloseButton  : true,
        showNavArrows : true,
        enableEscapeButton : true,
        enableKeyboardNav : true,

        onStart : function(){},
        onCancel : function(){},
        onComplete : function(){},
        onCleanup : function(){},
        onClosed : function(){},
        onError : function(){}
    };

【问题讨论】:

  • 我已设置 hideOnContentClick = false。它适用于图片库。但不适用于 iframe。
  • 在加载fancing框时发布代码的设置部分

标签: jquery fancybox


【解决方案1】:
hideOnOverlayClick  true    Toggle if clicking the overlay should close FancyBox
hideOnContentClick  false   Toggle if clicking the content should close FancyBox

阅读 api 应该可以帮助您了解所有不同的设置和选项,覆盖是黑色背景 [半透明]

http://fancybox.net/api

因此,您还应该检查 [inside] 您的 iframe 上的精美框选项是否不同,还要检查在您单击的内容之上没有另一个透明的元素,并且可能会显得愚蠢如果可能的话,明智地发布一个指向您网站的链接,或者使用 jsfiddle 仔细检查它是否是一个花哨的框错误,或者您所做的其他事情。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多