0
votes

I open another in a form with fancybox library.

I enter the code:

$(".fancybox").fancybox({
    fitToView: false,
    beforeLoad: function () {
      this.width = parseInt(this.element.data('fancybox-width'));
      this.height = parseInt(this.element.data('fancybox-height'));
    },
    iframe:{
      preload: !(document.all && !document.querySelector)
    },
    afterClose: function (a, b, c) {
      $("#BtnCerca")[0].click();
    },
    autoSize: false,
    closeClick: false,
    openEffect: 'fade',
    openEasing: 'swing',
    closeEffect: 'elastic',
    closeClick: true,
    padding: ['8', '8', '8', '8'],
  });

and clicked on the link I put the classes "fancybox fancybox.iframe" and the link to be opened is inserted nell'href, so that may open the second form as an iframe.

But it happens that when I open the iframe afterClose the event takes place before the opening of the form and not after its closure.

Something wrong? I ask for help .... david

1

1 Answers

0
votes

I plugged in the open in the form close button, the function:

function Close() {
              parent.verificatest = true;
              parent.$("#BtnCerca")[0].click();
              parent.$.fancybox.reposition();
            }

that click the link to the closure.

it works...

thank you