我使用Fancybox库使图像缩放效果。有我的Slim代码:
a data-fancybox="gallery" href=image.image.url(:large)
= image_tag image.image.url(:thumb), class: "image"
但是在关闭缩放图像后,文档顶部仍然有一个拇指尺寸的图像,并且CSS已经更改为:
<div class="fancybox-content" style="transform: translate(504.844px, 171.297px) scale(1, 1); width: 174px; height: 174px; transition-duration: 366ms;">
<img class="fancybox-image" src="/uploads/image/image/8042/large.jpg">
</div>
然后我不能单击其他任何按钮,因为顶部有图像封面。
有我的fancybox.js代码:
// Clicked on the content
clickContent: function(current, event) {
return current.type === "image" ? "zoom" : false;
},
// Clicked on the slide
clickSlide: "close",
// Clicked on the background (backdrop) element;
// if you have not changed the layout, then most likely you need to use `clickSlide` option
clickOutside: "close",
// Same as previous two, but for double click
dblclickContent: false,
dblclickSlide: false,
dblclickOutside: "close",
我的fancybox库版本是3.3.5。