为什么我的 Fancybox window 会立即打开和关闭?
Why does my Fancybox window open and close immediately?
我正在使用 barba js,我通常使用 php 列出图像。但是当我点击花式框时,花式框 window 再次打开和关闭。
列表
<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,
},
});
这样试试。
data-barba-prevent
<a href="..." data-barba-prevent><img></a>
我正在使用 barba js,我通常使用 php 列出图像。但是当我点击花式框时,花式框 window 再次打开和关闭。
列表
<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,
},
});
这样试试。 data-barba-prevent
<a href="..." data-barba-prevent><img></a>