FancyBox close from within iframe and take parent page to the link

前端 未结 3 1055
天命终不由人
天命终不由人 2020-12-29 23:26

I found applying the following function to a links onclose works to close Fancybox from within an iFrame: parent.$.fancybox.close();

I wan

3条回答
  •  不思量自难忘°
    2020-12-30 00:24

    You can also do this by writing a function on the parent page:

    function closeFancyboxAndRedirectToUrl(url){
        $.fancybox.close();
        window.location = url;
    }
    

    Then on the link within the iframe, you can do this:

    Close and go to page
    

提交回复
热议问题