开发者

Jquery colorbox, close colorbox after form submitted

Using colorbox:

http://colorpowered.com/colorbox/

Im using this to open a window up using the iframe function in colorbox. In the popup window/iframe I have a form. What Im trying to achieve is when the form is submitted I want the colorbox window to close and the parent window to refresh. Can anyone help me with th开发者_如何学Pythonis? Here is the code Im using now, when I manually close the colorbox window the parent page refreshes, but how do I tell the page inside the colorbox popup to close colorbox?

    jQuery(document).ready(function(){
        jQuery(".purchasepop").colorbox({width:"80%", height:"80%", iframe:true,
        onClosed:function(){ location.reload(true); }});
        });


Ok got it to work, was referencing the wrong "variable" as I am using noconflict to load jquery. This worked:

parent.jQuery.fn.colorbox.close();


I used the following code to close my the color box on my cancel button click event.

jQuery(document).ready(function () {
     jQuery("#<%= btnCancel.ClientID %>").click(function () {
        parent.jQuery.colorbox.close();
     });
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜