文档准备好后如何将 fancybox 图像加载到浏览器缓存中?

发布于 2024-11-26 01:23:59 字数 152 浏览 1 评论 0原文

我有一个包含十个锚定缩略图和一些事实的列表,当您单击缩略图时,Fancybox 窗口中会弹出一个整页图表。第一次单击任何特定缩略图时,会出现延迟,因为它将图像加载到缓存中。

如何将链接中的所有图像预加载到浏览器缓存中,以便它们在第一次单击时立即弹出到 Fancybox 中?

I have a list of ten anchored thumbnails and some facts, and when you click a thumbnail a full page chart pops up in a Fancybox window. There is a delay the first time you click any specific thumbnail as it loads the image into the cache.

How can I pre-load all of the images from the links into the browser cache so that they pop up instantly into a Fancybox the first time they are clicked?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉栀 2024-12-03 01:23:59

您可以通过创建一个不可见的 div 并包含 Fancybox 所需的所有图像来做到这一点。当文档准备就绪时,您就创建了这个 div。

<div style="display:none;">
    <img src="..." />
</div>

You can do that by creating a div not visible and containing all images that Fancybox require. And you create this div when doc is ready for sure.

<div style="display:none;">
    <img src="..." />
</div>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文