Skip to content

AfterClose event #438

Closed Answered by ducminhn
ducminhn asked this question in Q&A
Discussion options

You must be logged in to vote

Nvm, after a few more tries, I was able to do this using the code below:

const fancybox = new window.Fancybox([
  {
	  src: '#remove-item-popup',
	  click: false,
	  dragToClose: false
  },
  ], {
  on: {
	  closing: function (fancybox, event) {
		  const value =
			  event && event.target ? parseInt(event.target.dataset.value, 10) : 0;
  
		  console.log(`value: ${value}`);
	  },
  },
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ducminhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant