问题标签 [fancybox-3]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
5513 浏览

jquery - Fancybox 3 - 防止移动视图向上滑动或单击覆盖区域关闭

我正在尝试制作一个只能通过关闭按钮关闭的花式框。我查看了 fancyBox3 文档,但仍然不知道。fancybox 默认设置只能防止鼠标点击外关闭和鼠标触摸关闭。即使触摸设置设置为假,向上滑动或单击覆盖区域关闭问题仍然会在移动视图上发生。

我有一个示例脚本来显示fancybox。

HTML

JS

JSFIDDLE

有什么办法可以防止手机近距离滑动吗?谢谢!

0 投票
1 回答
1421 浏览

javascript - fancybox-3 打开 php 页面

我曾经使用版本 2,我想使用更新的版本进行更新。

大多数时候,我使用它通过调用 PHP 页面在我的窗口中打开一个窗口。

请在下面找到我的 JS 函数来调用一个花哨的框 2:

现在我的呼叫 JS 有这个功能:

今天我想让它进化以适应这个新版本。问题是我不能用新版本做这种新功能。请在下面找到我的研究开始:

我什至无法用 php 页面打开一个花式框

您能否告诉我我的请求是否可行,也许我可以使用您的一些帮助。

先感谢您,

0 投票
0 回答
828 浏览

fancybox-2 - Fancybox 宝石导轨 5.1

目前,对于 Rails 5.1,我们似乎没有任何兼容的 Fancybox gem 最新的 Fancybox3 与 rails 5.0 兼容,但不兼容 5.1(https://github.com/fobiasmog/fancybox3/issues/3)。

我正在将我的应用程序从 Rails 4.2.7 版本升级到 Rails 5.1.4,我需要帮助找出 Fancybox 的替代方案。

0 投票
2 回答
390 浏览

javascript - 在 FancyBox3 的自定义基本模板中定位一个类

我创建了一个自定义基本模板,如下所示:

如何定位自定义类 sharefb?因为我想动态更改数据共享属性。

谢谢!

0 投票
1 回答
704 浏览

javascript - Fancybox 3 设置超时?

我希望页面加载后大约 5 秒在 Fancybox 3 中触发一个内部 URL。我有以下代码,但是我只是加载 PNG - 什么都没有出现。

我对 JS 不是很聪明,尽管我相信它可能会与其他一些代码发生冲突。在这台 Mac 退出窗口之前有什么建议吗?

谢谢 :)

0 投票
1 回答
2045 浏览

javascript - 在按钮单击时更新 fancybox 当前幻灯片内容

我想根据内容类型更新当前幻灯片的内容。如果我尝试设置内容,而不是显示 pdf 或图像,它只显示 html 字符串。

这是我的代码:

代码笔

任何帮助表示赞赏。谢谢

0 投票
1 回答
316 浏览

fancybox-3 - 覆盖 Fancybox 的设置

我是我的项目,我需要覆盖fancybox 的默认设置。缩略图autostarttrue如下所示。我该怎么做。

0 投票
1 回答
242 浏览

jquery - Fancybox works in initially rendered HTML but not in HTML rendered as a result of ajax calls

I am writing a plugin (I have written many) and decided to try Fancybox for the first time to display png images in a popup. The plugin works well for the html that is initially part of the initial page render, but identical html that I return from an ajax call does not result in a popup and does not throw errors.

My question is this: When the html is injected into a div as the result of an ajax call, is it still possible to use Fancybox and Thickbox for popups? If so, what is wrong here?

This is how I create the html in the ajax call:

The exact same code is used for the html that renders the initial page - and again the initial render works but the html from the ajax call does not.

I suspect that the problem is in my jQuery which is in a separate file:

The initial render also contains this relevant html which kicks off the ajax call and provides a location to place the result:

The Fancybox Settings in Wordpress have Extra Calls checked with these set up to add to the Fancybox jQuery:

The CSS that I enqueue is simply formatting and not relevant.

That is all I can think of to include, but please do not hesitate to ask for more. The Error Log is unremarkable and the browser console does not report any errors. When clicking on the View links in the initial render, the Fancybox popup shows (as does a thickbox when I tried that) - but the html that is injected into the ChoiceResult div as a result of the ajax call does not on either Fancybox or the built-in thickbox.

Thanks in advance for any light that anyone can shed.

0 投票
1 回答
324 浏览

jquery - Fancybox-3 导致 URL 问题

我刚刚开始了一个基本的 HTML 页面,以掌握如何Fancybox-3在我的网站代码中实现。当我选择两个缩略图中的任何一个时,它们的全尺寸 IMG 会出现(如预期的那样),但是'C:/'URL 中会出现另一个!每次我选择任一图像上的'Next'或箭头时,这种情况都会变得复杂,因为这会在不断扩展的 URL 中'Back'插入另一个。'C:/'

例如 file:///C:/C:/C:/C:/Users/Peter%20Johnstone/Desktop/...

0 投票
1 回答
896 浏览

jquery - fancyBox3 触发一个 iframe

在旧的 fancyboxversion 中,我使用此代码打开一个 iframe

在新版本中是不可能的。有任何想法吗?