@fancyapps/fancybox

中文文档
3.5.7发布于 2019/03/12GPL-3.0CommonJS零依赖近 30 天下载 15.1万

Touch enabled, responsive and fully customizable jQuery lightbox script

原始使用文档
文档目录3 节
  1. Quick start
  2. License
  3. Bugs and feature requests

fancyBox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

See the project page for documentation and a demonstration.

Follow @thefancyapps for updates.

Quick start

1. Add latest jQuery and fancyBox files

<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>

<link  href="/path/to/jquery.fancybox.min.css" rel="stylesheet">
<script src="/path/to/jquery.fancybox.min.js"></script>

2. Create links

<a data-fancybox="gallery" href="big_1.jpg">
    <img src="small_1.jpg">
</a>

<a data-fancybox="gallery" href="big_2.jpg">
    <img src="small_2.jpg">
</a>

3. Enjoy!

License

fancyBox is licensed under the GPLv3 license for all open source applications. A commercial license is required for all commercial applications (including sites, themes and apps you plan to sell).

Read more about fancyBox license.

Bugs and feature requests

If you find a bug, please report it here on Github.

Guidelines for bug reports:

  1. Use the GitHub issue search — check if the issue has already been reported.
  2. Check if the issue has been fixed — try to reproduce it using the latest master or development branch in the repository.
  3. Isolate the problem — create a reduced test case and a live example. You can use CodePen to fork any demo found on documentation to use it as a template.

A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report.

Feature requests are welcome. Please look for existing ones and use GitHub's "reactions" feature to vote.

Please do not use the issue tracker for personal support requests - use Stack Overflow (fancybox-3 tag) instead.

版本与发布记录

@fancyapps/fancybox 共发布 24 个版本,首次发布于 2017/03/25;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.5.7latest2019/03/127 年前
3.5.62018/12/147 年前
3.5.52018/12/137 年前
3.5.42018/12/127 年前
3.5.32018/12/107 年前
3.5.22018/10/058 年前

关于 @fancyapps/fancybox 的常见问题

@fancyapps/fancybox 是什么?

Touch enabled, responsive and fully customizable jQuery lightbox script

如何安装 @fancyapps/fancybox?

在项目目录运行 npm install @fancyapps/fancybox,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:jquery(>=1.9.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fancyapps/fancybox 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fancyapps__fancybox 是否存在。

@fancyapps/fancybox 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fancyapps/fancybox 可以商用吗?

@fancyapps/fancybox 使用 GPL-3.0 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@fancyapps/fancybox 的下载量有多少?

根据 npm 官方下载统计,@fancyapps/fancybox 在 2026/10/14 – 2026/11/12 这 30 天内被下载 151,225 次,日均约 5,041 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fancyapps/fancybox 还在维护吗?

最新版本 3.5.7 发布于 2019/03/12(7 年前);至今共发布 24 个版本,其中过去 12 个月发布了 0 个;首次发布于 2017/03/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。