提交后关闭ColorBox iFrame [英] Close ColorBox iFrame after submit
本文介绍了提交后关闭ColorBox iFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用jQuery ColorBox
来显示购物车项目。当用户在iFrame中输入数量(使用colorbox打开)并单击提交按钮时,我希望iFrame关闭,主窗口(父)将自动刷新。
I'm using jQuery ColorBox
to display a shopping cart item. When a user enters the quantity in the iFrame (opened with colorbox) and clicks on the submit button, I want the iFrame to be close and main window (parent) to be refreshed automatically.
我的意思是我在iFrame上提交数据后想要两件事:
I mean I want two things after submitting data on iFrame:
- iFrame会自动关闭。
- 父窗口自动刷新。
请帮帮我。
推荐答案
在打开iframe时在父窗口中使用它:
use this on the parent window while opening iframe:
$(document).ready(function(){
$(".chpic").colorbox({width:"80%", height:"80%", iframe:true,
onClosed:function(){ location.reload(true); } });
});
这将关闭iframe页面中的iframe:
and this to close the iframe inside iframe page:
parent.$.fn.colorbox.close();
这篇关于提交后关闭ColorBox iFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文