图片幻灯片停止功能

Image Slideshow Stop Function

如本文所述。我想为 apostrophe-image-widget slide 功能添加一个新功能,但我不知道具体怎么做。

为了进一步解释,我认为为小部件播放器设置一个停止功能是有意义的,可以像 data-nextdata-previous 那样调用,也许 data-stop 会很好。

所以我的问题是我可以在:

// example of a widget manager with a play method.
// You don't need this file at all if you
// don't need a player.

apos.define('apostrophe-images-widgets', {
  extend: 'apostrophe-pieces-widgets',
  construct: function(self, options) {
    self.play = function($widget, data, options) {
      $widget.projector(options);
    };
  }
});

我能否得到一些提示,了解如何访问这些 data-next 函数并按照描述扩展它们?

由于 Apostrophe 的幻灯片所依赖的基础 jQuery 插件不支持您所询问的功能,因此您必须将该功能 PR 到插件中(可在此处 https://github.com/punkave/jquery-projector 找到)然后将更新 PR 到 Apostrophe 核心。

或者,您可以编写自己的 images 小部件并将自己的幻灯片插件带到聚会中。您将在小部件的播放器中初始化幻灯片插件,类似于您在上面粘贴的播放器片段。

许多 Apostrophe 开发人员为项目带来的流行幻灯片库是 Swiper https://idangero.us/swiper

您可以在 Open Museum 项目中看到 Swiper 在 Apostrophe 中的示例实现 https://github.com/apostrophecms/apostrophe-open-museum/tree/master/lib/modules/slideshow-widgets