开发者

how to close parent window when colorbox is closed?

开发者 https://www.devze.com 2023-01-22 09:12 出处:网络
I\'m loading colorbox on page load. parent.$.fn.colorbox({href: \"#inline_example1\", overlayClose:false, inline:true,width:\'80%\',height:\'90%\', onClosed:function(){} ,开发者_开发技巧onLoad: funct

I'm loading colorbox on page load.

parent.$.fn.colorbox({href: "#inline_example1", overlayClose:false, inline:true,width:'80%',height:'90%', onClosed:function(){} ,开发者_开发技巧onLoad: function() { }});

I want to close the parent window when the colorbox is closed. Please tell me what should I write inside onClosed function.


Your question is not very clear what parent is but try something like:

window.opener.close();

or

window.close();

or

window.parent.close();

I hope one of these would help!!


In your onClosed handler, you could put:

window.close();
0

精彩评论

暂无评论...
验证码 换一张
取 消