Fancybox - Update Parent after close

Asked

Viewed 152 times

0

I am using an iframe Fancybox where when the user confirms a question I want to update the content of the original page after success in an ajax:

    $.ajax({
        type: 'POST',
        url: 'excluir_foto2.asp',
        data: {cod: cod},
        success: function () {

            parent.$("#Itemwookmark" + '<%=id_wookmark%>').fadeOut(1000, function () {
                parent.$("#Itemwookmark" + '<%=id_wookmark%>').remove();
                parent.wookmark.initItems();
                parent.wookmark.layout(true);
                parent.$.fancybox.getInstance().close();
            });
        }
    });

But currently, to work, I had to put to remove the item inside Wookmark, update Wookmark and only then call the method. close() to close the fancybox.

Is there any way I can close fancybox first and then remove the Wookmark item?

  • Have you tried callback onClosed Fancybox? It performs a function after the Fancybox is closed.

  • Yes I had given a read on how to implement it. But how could I get past which itemwookmark would be removed before upgrading the entire Wookmark?

  • Change the order of the commands, put what closes the fancybox before the remove(). fancybox will close but other commands will be executed normally.

  • I tried to do this. But then the variable "Parent" is Undefined and I can’t change anything else in the parent element. Even if you take off the Parent, nothing happens :(

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.