htmljqueryfancybox-3barbajs

Why does my Fancybox window open and close immediately?


i am using barba js, i am listing image normally with php. But when I click on the fancy box, the Fancybox window opens and closes again.

fancybox

list

<a href="http://localhost/upload/pages/home/home_3894.png" data-fancybox="images" data-caption="aaa">
    <img class="product-image main-image" src="http://localhost/upload/pages/home/home_3894.png" data-image-id="64>
</a>

<a href="http://localhost/upload/pages/about/about_3895.png" data-fancybox="images" data-caption="aaa">
    <img class="product-image main-image" src="http://localhost/upload/pages/about/about_3895.png" data-image-id="66>
</a>
jQuery('[data-fancybox]').fancybox({
        backFocus: false,
        buttons: [
            "zoom",
            "share",
            "slideShow",
            "fullScreen",
            "download",
            "thumbs",
            "close"
        ],
        thumbs: {
            autoStart: true,
        },
    });

Solution

  • try it this way. data-barba-prevent

    <a href="..." data-barba-prevent><img></a>