I am using this library to show fancyboxes: https://fancyapps.com/docs/ui/quick-start
Now I want to execute a function when next is triggered in the fancybox but I can't get it to work.
Here is the script I am currently using:
Fancybox.bind("[data-fancybox]", {
next: function() {
return(console.log('Next called');
}
});
But it is not working, does someone know why?
Thanks a lot!
your code is not syntactically correct. Exemaple, should look like this:
Fancybox.bind("[data-fancybox]",{
next: ()=>{
return(console.log('Next called'));
}
});
But for events, you need use https://fancyapps.com/docs/ui/fancybox/events like as https://jsfiddle.net/wfkbugpq/2/