[英]How to Reopen parent fancybox by closing child fancy Box?
I am using the fancybox from the link: fancyapps 我正在使用链接中的fancybox: fancyapps
In my page i have two editions : 在我的页面中,我有两个版本:
first edit link is as follows : 第一个编辑链接如下:
<a id="edit_campaign" title="Edit Campaign" class="edit_icon fancybox1 fancybox.ajax" href="edit_campaign_box.php?campId=<?php echo campid ?>"></a>
when i click the above link , fancy box will be opened using the js 当我单击上面的链接时,花式框将使用js打开
$(".fancybox1").fancybox({
maxWidth : 650,
minHeight : 400,
height : 'auto',
fitToView : true,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
helpers : {
overlay : {
css : {
cursor : 'default'
},
closeClick: false
}
}
});
and after opening the fancybox , i need to open another fancybox during clicking the following link : 在打开fancybox之后,我需要在单击以下链接期间打开另一个fancybox:
<a title="Edit" class="edit_icon fancybox2 fancybox.ajax " href="edit_campaign_phrase_box.php?keyword=<?php echo urlencode($camp->keyword);?>&searchKeyId=<?php echo $camp->searchKeywordId;?>&campaignId=<?php echo $campaignId;?>"></a>
2nd fancybox will be opened using 第二个fancybox将使用打开
$(".fancybox2").click(function(){
$(".fancybox2").fancybox({
maxWidth : 300,
maxHeight : 80,
fitToView : false,
height : 'auto',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
afterClose : function(){
$.fancybox.open([{href : 'edit_campaign_box.php?campId=264',title : 'Edit Campaign'}]);
},
helpers : {
overlay : {
css : {
cursor : 'default'
},
closeClick: false
}
}
});
});
After opening 2nd fancybox , I will update the form and close the fancybox2. 打开第二个fancybox之后,我将更新表单并关闭fancybox2。
After closing the fancybox2 , i need to reopen fancybox1 , i tried by adding callback to the 2nd fancybox but the callback function is called number of times but fancybox 2 is not opening .. please help me.. Thanks in advance .. 关闭fancybox2之后,我需要重新打开fancybox1,我尝试通过向第二个fancybox添加回调,但是该回调函数被调用了几次,但是fancybox 2没有打开..请先帮助我。
Now I have got output , by changing the old version of fancybox to new and replacing the single code of fancybox 2: 现在,通过将fancybox的旧版本更改为新版本并替换fancybox 2的单个代码,我得到了输出:
afterClose : function(){
$("#edit_campaign").trigger("click");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.