Fancybox没有导航按钮,但画廊工作

时间:2017-08-03 08:45:31

标签: javascript jquery html thymeleaf fancybox-2

我正在商业网站上实习,并且我被要求添加Fancybox显示产品的图像。它看起来不错但导航按钮丢失了。但是,我仍然可以在图片之间导航。

是的,它设置为图库并且我已检查过其他帖子,照片必须位于同一位置。
但正如我所说,画廊有效,但没有任何按钮,我只是想法。

该项目使用了很多东西,但我会添加我添加代码的地方。 它使用Thymeleaf,Spring,bootstrap,fancybox 2.1.5等,我目前正在使用IntelliJ IDE。此外,我可以在" _main.less"上编辑fancybox属性。该项目。

$(".zoomPic").fancybox({
    'transitionIn': 'fade',
    'transitionOut': 'fade',
});
<div class="bgstretch slide zoomPic"
     th:style="${'background-color: #' + image.colour}"
     th:each="image : ${product.images}" data-fancybox-group="gallery"
     th:attr="data-fancybox-href='#fancyGallery'+__${image.id}__">

  <span th:attr="data-srcset=${image.path},data-imageid=${'image' + image.id}"></span>

  <div th:id="'fancyGallery'+__${image.id}__" style="display: none;">
    <img th:src="${image.path}" style="width:100%;height:100%;"/>
  </div>
</div>

实际上并不需要工作按钮。一边漂浮在左右的左右人字形就足够了。所以,我打开了关于直接将它们放在前面的建议,但我也不知道如何做到这一点。 关闭按钮和我需要工作的所有其他功能,但这不是。

1 个答案:

答案 0 :(得分:0)

原来我的程序既没有下载也没有存储fancybox_sprite.png,它保存了prev,next和close按钮的图像。当我第一次启动fancybox时,它发出了一些错误,告诉我它无法访问某些背景照片。认为这些是不必要的,我删除了这些代码行,以免得到任何错误。我偶然发现了这个问题,它有我的答案:Fancybox 2 arrows not showing up 只是下载了图像,它的工作原理。