2011-05-08 92 views
1

我遇到了jquery fancybox的問題。我正在用fancybox展示一個表格。使用iframe。當我點擊彈出窗口中的任何地方時,它正在關閉。如果點擊textbox/textarea,它正在關閉。我只希望它在我點擊關閉按鈕或提交表單按鈕時關閉。任何幫助?jquery fancybox問題

的鏈路

<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(){} 
    }; 
+0

我設置了hideOnContentClick = false。它對於圖庫有好處。但不適用於iframe。 – 2011-05-08 05:12:26

+0

發佈代碼的設置部分,同時加載發現框 – kobe 2011-05-08 05:15:42

+0

添加了一些細節 – 2011-05-08 05:57:18

回答

0
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

所以你還應該檢查花哨[iframe]框內的選項沒有區別,請檢查在您點擊的內容的頂部沒有其他元素頂部是透明的,並且可能會愚蠢地以其他方式發佈鏈接到您網站的鏈接(如果可能)或使用jsfiddl e再仔細檢查一下它是否是一個奇怪的盒子錯誤,或者是你做過的事情造成這種錯誤。