我有2个fancyboxes,我试图从所述第一打开第二(或者通过按钮或通过闭合第一)..如何关闭另一个Fancybox后关闭?
<div id="firstFancybox" style="display:none">
<p>I'm the first Fancybox!</p>
<a id="fancyboxButton" href="#secondFancybox">Close first Fancybox</a>
</div>
<a id="hiddenLink" href="#firstFancybox"></a>
<div id="secondFancybox" style="display:none">
<p>I'm the second Fancybox!</p>
</div>
第一的fancybox正在对页负载活化..
$(document).ready(function() {
$("a#hiddenLink").fancybox({ 'hideOnContentClick': false, 'frameWidth': 300, 'frameHeight': 300 }).trigger('click');
$("a#fancyboxButton").fancybox();
});
我希望能够在第一个关闭时打开第二个fancybox。或者..点击第一个按钮打开第二个。
这是如何实现的?我没有太多的运气绑定到我害怕的事件上。
- 李
UPDATE:
使用callbackOnClose是让我做简单的东西,像警报( '你好'),但我还没有成功地打开其他的fancybox呢。
$(document).ready(function() {
$("a#hiddenLink").fancybox({ 'hideOnContentClick': false, 'frameWidth': 300, 'frameHeight': 300,
callbackOnClose: function() { alert('hi'); }
}).trigger('click');
});
我从来没有尝试过,但好像你必须使用 “callbackOnClose” 事件触发另一个打开。 – 2009-11-11 15:40:59
好的头像...随机巧合?还是应该受宠若惊? ;-) – scunliffe 2009-11-11 15:41:25
scunliffe,发现头像年龄前,喜欢它。不知道我是否偷走了你或不害怕。如果你喜欢,可以有点受宠若惊。 ;-) – 2009-11-11 15:45:18