我有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