问题标签 [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 投票
1 回答
1636 浏览

fancybox-3 - Fancybox3 iframe 滚动

如果内容高于我的定义,我想为 iframe 添加滚动条,下面的代码不起作用:

0 投票
2 回答
668 浏览

jquery - 基本的 Fancybox 实现

我一直无法让一个基本的 jquery fancybox 工作。我尝试从fancybox 网站(http://fancybox.net/howto)上的文档工作,这是一个单独网站上的教程(http://www.websitecodetutorials.com/code/jquery-plugins/jquery-fancybox.php),我尝试浏览其他一些相关帖子以检查常见问题(基本“jquery fancybox”)、(Fancybox 不工作)、(FancyBox 根本不工作)。

我觉得我忽略了一些简单的事情。在调用fancybox 之前,我使用CDN 调用jquery。我有一个指向 fancybox css 文件的链接。我尝试将脚本调用移动到 head 和 body 标签内的 fancybox。

我已经测试过 jquery 可以与成功触发的警报功能一起使用。fancybox css 和 js 文件与我的 html 文件和图像位于同一目录中。以下是我目前正在测试但没有成功的精简 HTML。

HTML:

结果与排除 fancybox 的行为相同。它显示小图像,当您单击它们时,您将离开页面以查看大图像。

更新:控制台日志中出现以下错误:

非常感谢任何帮助。谢谢!

0 投票
1 回答
766 浏览

fancybox - Prevent vertical scrollbar from sliding with fancybox slides

I've encountered an issue where the browser's vertical scrollbar will, if visible, move along with a fancybox slide during the slide event. If you run the code snippet, adjust the height so that the vertical scrollbar becomes visible, and then click on the next/previous fancybox buttons to observe the sliding scrollbar behavior.

Screenshot of fancybox slide effect

Is this a bug? Any idea on a workaround? I tried hiding/showing the scrollbar before and after the slide transition, but this didn't work:

0 投票
2 回答
1173 浏览

jquery - Fancybox 图片库和 HTML 列表

我正在做一个学校项目,我尝试使用 Fancybox 创建一个画廊。我的问题是:图库已创建,您可以在侧列表菜单上看到图库的所有图像,所有功能都运行良好,除了无论您首先单击什么图像,甚至在模态“窗口”中浏览图库仅显示该组的第一张图像,甚至不显示所有其他图像。

我可能做错了,所以这是我的代码。

这是我的 HTML(仅重要部分):

头部脚本

列表

这是我用来修改这些图像周围的每个链接的 javascript:

这是一个 JSfiddle:https ://jsfiddle.net/Voltra/h8g2hcu7/10/

(注意:在小提琴中似乎一切正常,但我做了相同的更改(链接到 cdn 以获取完全相同版本的 jQuery 等......)并且它并没有解决我的问题)

0 投票
1 回答
12996 浏览

fancybox - 使用带或不带缩略图的 Fancybox 3 图像库?

我对 Fancybox 3 有疑问。我有很多(10-15)个图片库的网页,每个图片库大约有 50 张图片。每个画廊在主页上都有一个图片链接。什么花式盒子使用更好/更有效?:

  1. 不使用缩略图 -> 缩略图网格是从大尺寸图像生成的 -> 效果:打开一个画廊时会加载所有大图片。

    /li>
  2. 与缩略图一起使用 -> 缩略图网格是从缩略图小尺寸图像生成的 -> 效果:打开主页时,所有缩略图都会在没有任何画廊打开的情况下加载。

    /li>
0 投票
1 回答
1550 浏览

jquery - FancyBox 中的“全屏”和“关闭”按钮

我将 FancyBox v3.0.47 用于 Ajax(html 文件)。我们的测试人员注意到,全屏和关闭按钮被模式屏幕的垂直滚动区域遮住了。

有没有办法调整控件的右边距以将控件向左移动大约 12px?我尝试在下面的 CSS 中设置右边距,但这不起作用。我是否处于正确的控制状态,还是应该寻找其他地方?

0 投票
1 回答
990 浏览

html - 我如何使用 Fancybox 3 从 iframe 内部访问和控制父窗口中的 fancyBox

我不是一个真正的程序员,只是一个多年来一直在蚕食脚本的 HTML 编码器,却无法真正理解我在做什么。我终于陷入了僵局。

我正在使用 Fancybox 3 打开一个响应式 iFrame,我在其中加载了一个设置为自动播放的 HTML5 视频。一切都很好,除了 iFrame 是 a) 最初在底部裁剪(通过稍微调整浏览器窗口大小立即修复的错误)和 b) 当窗口缩小时不调整内容的大小。我在视频下方打开了空白区域。

Fancybox 3 文档建议使用这段脚本来实现我所追求的,但没有解释如何准确地实现它。我猜作者认为我对这些事情的了解比我知道的多,这似乎很公平。

这是脚本的片段:

我猜这会解决我所有的问题。谁能告诉我如何实现它?

有问题的页面在这里:test page

Fancybox 3 文档在这里

如果我问这个问题很糟糕,请告诉我,因为我是这里的新手。

感谢您的关注。

0 投票
1 回答
1228 浏览

javascript - "back" behaviour with fancybox3

I've been using fancybox for quite a while now and only recently decided to try out fancybox3. I really enjoy fb3, but something is very strange to me.

After opening a gallery made with <a data-fancybox="mygroup">IMAGE STUFF HERE</a> fancybox is adding hashes to the URL in the browser (chrome, ff, edge, safari) eg. example.com/gallery.html#mygroup-8

When I now press the back button in my browser (or a button with javascript:history.back) it will not go back to the last page but instead will open the gallery again with the last image I viewed - which is obviously not what I wanted.

FB2 didn't do that, so I'm kinda wondering how I get rid of that but I couldn't find anything in the docs about this "problem"

Or is it about the code? I'm using this, more or less:

I'm using fancybox 3.0

0 投票
1 回答
142 浏览

javascript - Fancybox3 可以发送 iframe 类型的请求参数吗?

我的管理面板中有一个花式框,它应该显示一个用于添加/编辑菜单项的表单。该表单位于另一个页面上,如果我像往常一样尝试加载此页面,我将看到在正常上下文中定义的所有导航栏、页脚等,但我使用的是旧 ZF1,它有一个名为“上下文”的东西可以更改当前上下文取决于 $_REQUEST['format'] 变量。

问题有点复杂,所以有一个简短的版本,没有我的问题的描述:

有没有办法加载 iframe fancybox3 并将format = 'fancybox'变量发送到请求的页面?

0 投票
1 回答
694 浏览

php - Wordpress 中的 Fancybox 编码 - 图像链接

我很难过。首先,这是一个安装在主题上的 Fancybox,而不是插件,其次 - 我还在学习 - 所以非常感谢您的帮助!

Fancybox 需要一个 href 链接来打开/加载 wordpress 帖子中的图像。

我正在使用“获取附加媒体”来获取帖子上的所有图像。

我可以在哪里以及如何创建 Fancybox 的 href 链接以在其中工作?

这是我正在使用的代码:

这是 Fancybox 文档:

任何帮助都会很棒......我在学习曲线的这一部分上感到困惑。