Fancybox 4: How to prevent close button from closing *all* open Fancybox instances
If I launch a Fancybox instance, and then launch a Fancybox gallery from that instance, hitting Esc or clicking the "close" button on the gallery instance closes both the fancybox gallery and the original fancybox instance instead of just the gallery.
<html>
<body>
<a href="javascript:void(0);" onclick="openFancybox();">Open Fancybox</a>
</body>
</html>
function openFancybox () {
const fancybox = Fancybox.show(
[
{
src: '<img src="https://i.imgur.com/6wb3Nd1.png" data-fancybox="gallery"><img data-src="https://i.imgur.com/ZITI3TN.png" data-fancybox="gallery">',
type: 'html',
}
]
);
}
https://codepen.io/jetibbetts/pen/RwgzBZx
Only the top-most instance should close. How can I prevent both from closing?
from Recent Questions - Stack Overflow https://ift.tt/3mqQk1V
https://ift.tt/eA8V8J
Comments
Post a Comment