Fancy Box - how to refresh parent page when close iframe popup?

前端 未结 12 871
逝去的感伤
逝去的感伤 2020-12-28 19:16

I want my parent page to refresh when I close a Fancy Box popup frame. I have a login page inside the popup, so I need the parent page to refresh to show the new login state

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-28 19:58

    For me next code works ok:

    $("a.ic-edit").fancybox({
                'width'     : '65%',
                'height'    : '85%',
                'autoScale'     : false,
                'titleShow' : false,
                'transitionIn'  : 'no',
                'transitionOut' : 'no',
                'scrolling'     : 'no',
                'type'          : 'iframe',
                onCleanup   : function() {
                    return window.location.reload();
                }
           });
    

    I can't say exactly, but maybe the reason in using "onCleanup" (actually I didn't try use onClosed).

提交回复
热议问题