Home > front end >  How to pass jquery object and opts on fancybox.open()?
How to pass jquery object and opts on fancybox.open()?

Time:06-22

Hello everyone so i've ran into a problem. I've got a jquery object: const popup = $('#popup') and I pass it to fancybox $.fancybox.open(popup); but I also want to run an afterClose on this popup, didn't manage to find any info on how to do this. Did anyone run in this problem? How did you solve it?

CodePudding user response:

$.fancybox.open({
    src  : '#popup',
    type : 'inline',
    opts : {
      afterShow : function( instance, current ) {
        console.info('done!');
      }
    }
  });
  • Related