我已經在SO上搜索過類似主題,但沒有任何解決方案適用於我。我通過Ajax鏈接填充我的頁面。像這樣:動態鏈接上的Fancybox
$.post('php/common/auction_view/auction_invoices.php', function(data){
$('#auction-invoices').html(data);
//Initiate Fancybox on links
$("a.example4").fancybox({
'opacity' : false,
'overlayShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'type' : 'iframe'
});
});
雖然,這是行不通的。有沒有人有辦法解決嗎? Thanx!
編輯:奧基,找到了解決辦法:
$.post('php/common/auction_view/auction_invoices.php', function(data){
$('#auction-invoices').html(data);
$.getScript("fancybox/jquery.fancybox-1.3.4.js", function(){
$.fancybox.init();
$("a.example4").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'overlayShow' : false,
'showCloseButton' : true,
'width' : 450,
'height' : 585,
'titleShow' : false,
'type' : 'iframe'
});
});
});
enter code here
你試過綁定這個嗎? $(「a.example4」)。bind(function(){$(this).fancybox({});});.這可能是問題。 – Ohgodwhy 2012-03-07 10:03:26
我應該把它放入ajax調用嗎? – Ismailp 2012-03-07 10:05:23