【问题标题】:Fancybox no nav buttons but gallery worksFancybox 没有导航按钮,但画廊作品
【发布时间】:2017-08-03 08:45:30
【问题描述】:

我正在一家商业网站实习,我被要求添加产品图像的 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>

实际上并不需要一个工作按钮。左右浮动的人字形就足够了。所以,我愿意接受有关直接将它们放在前面的建议,但我也不知道该怎么做。 关闭按钮和我需要的所有其他功能都可以工作,但这不是。

【问题讨论】:

    标签: javascript jquery html thymeleaf fancybox-2


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2018-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-29
      • 2018-06-02
      • 2020-03-09
      • 1970-01-01
      相关资源
      最近更新 更多