2011-11-01 56 views
3

我想調用fancybox對話框(內容加載爲iframe)的加載函數,但調用「callbackOnShow」不起作用。感謝任何幫助。Fancybox callbackOnShow not working

這裏的代碼片段:

的jQuery:

$("#link1").fancybox({ 
     'width': '50%', 
     'height': '50%', 
     'autoScale': false, 
     'transitionIn': 'none', 
     'transitionOut': 'none', 
     'type': 'iframe', 
     'callbackOnShow': function() {    
       alert("Hello");    
     } 
    }); 

HTML代碼,在顯示的fancybox:

<div> 
    <div class="signup">    
     <div id="test">   
      <a id="Log" class="but" href="#"><strong>Sign in</strong> </a>   
    </div> 
    </div> 
</div> 

回答

0

您有以下選擇:

  • 在onStart
  • onCancel
  • 的onComplete
  • onCleanup
  • onClosed

我個墨水你正在尋找的是onComplete功能。一旦顯示內容,將會調用onComplete。

0

您可能正在使用fancybox的最新版本(2.0.1)。在那裏,回調名稱是不同的。

其實,沒有仍callbackOnShow)和你的職位是的fancybox的最後一個版本之前寫的...

但對於球員環顧四周,然後回調onCompleteafterShow更換!