2012-08-27 71 views
0

我從IFRAME調用fancybox並將其顯示出IFRAME - 它工作。但是 我有一個回調函數的問題。 [我正在使用FanxyBox 2]FancyBox out of IFRAME callback

我想用 回調函數修改Prev/Next按鈕的不透明度和懸停行爲,但它什麼也不做。

的iFrame演示[點擊圖片]:http://keramika.dtech.sk/Keramika/Svietidla_Lampy.html

我已經在這個「非IFRAME」演示實現正確的行爲:http://keramika.dtech.sk/test.html

據我瞭解回調函數從「父母」的角度運行,因此調用$(「。fancybox-prev」)是正確的(不在範圍之外)。

回調 'afterShow':

'afterShow': function(){ 
      $(".fancybox-prev").css({"opacity": 0.1, "left":"-20px"}); 
      $(".fancybox-prev").hover(function(){ 
       $(this).css({"opacity": 0.6}); }, 
       function(){ $(this).css({"opacity": 0.1}); 
      }); 

這是一個更大的部分代碼:

$(document).ready(function() { 
$('#launcher').click(function(e){ 
e.preventDefault(); 
    parent.jQuery.fancybox([ 
    {href:'/Keramika/Media/lampy/800x600/luci_obr2.jpg', title: '01'}, 
    {href:'/Keramika/Media/lampy/800x600/luci_obr3.jpg', title: '02'}, 
    {href:'/Keramika/Media/lampy/800x600/luci_obr4.jpg', title: '03'} 
    ], 
    { 
    'afterShow': function(){ 
      $(".fancybox-prev").css({"opacity": 0.1, "left":"-20px"}); 
      $(".fancybox-prev").hover(function(){ 
       $(this).css({"opacity": 0.6}); }, 
       function(){ $(this).css({"opacity": 0.1}); 
      }); 
    ... 
+0

你試過'beforeShow'呢? – JFK

+0

我試過但行爲一樣 –

回答