Fancybox3 缩略图底部或右侧取决于方向

时间:2021-03-03 15:53:08

标签: javascript fancybox orientation fancybox-3

我正在开发一个网页,在其中我使用fancybox3 作为灯箱。在我自己的 CSS 中,我可以根据设备方向实现拇指面板的位置。我现在的问题是选项轴,它作为 JavaScript 调用的参数给出。根据方向更改此参数的最佳方法是什么?

thumbs: {
    autoStart: false,
    hideOnClose: true,
    parentEl: ".fancybox-container", 
    axis: "y" // <- This parameter x for portrait and y for landscape
  },

有关详细信息,请参阅 https://fancyapps.com/fancybox/3/docs/#options

下面是fancybox 3 的示例。底部的拇指面板适用于纵向,横向时应位于右侧 Example of the fancybox 3 in action. The thumb panel at the bottom is correct for portrait orientation and should be on the right at landscape orientation

0 个答案:

没有答案
相关问题