我有问题fancybox。
我想写一个函数,当fancybox打开时将运行。如何以及何时调用该函数?jquery - fancybox和回调
实施例:
function myFunc() {
alert("Opened!");
}
$('.content a').fancybox({
'hideOnContentClick': false ,
'callBackOnShow': myFunc(), // This not working! It call function when page is loaded
'frameWidth': 920,
'frameHeight': 530
});
如果有人来到这里,正在寻找Fancybox新版本的回调:请检查“onComplete”属性。 – AsTeR 2012-02-11 16:26:43
对于fancybox版本2或更高版本,它已更改为afterLoad。 http://fancyapps.com/fancybox/#docs – coderates 2012-05-22 17:11:01