Fancybox 2.0.4 fancybox 功能已从 jquery 插件中删除

发布于 2024-12-29 21:47:55 字数 576 浏览 4 评论 0原文

首先是使用新版本fancybox时遇到的问题(http://fancyapps.com/fancybox/)。

我有一个使用 ajax 加载大部分页面的应用程序。场景如下:

  1. 我的主页加载了 jquery、jquery-ui 和 fancybox
  2. 单击链接,fancybox 将打开并显示 ajax 内容
  3. 当 ajax 加载 jquery-ui 选项卡时,会触发一些选项卡(打开的窗口包含选项卡), ajax内容中的一些链接也绑定在fancybox中打开
  4. 单击ajax内容中的链接并加载另一个ajax内容。
  5. 加载内容后,window.$ 存在,但 window.$.fancybox 未定义。

什么可以从 jquery 插件中删除 fancybox? 我还附上了一张带有控制台的图像,解释了步骤。

在此处输入图像描述

First of all the issue is encountered when using the new version of fancybox (http://fancyapps.com/fancybox/).

I have an application which loads most of the pages using ajax. The scenario is the following:

  1. My main page loads with jquery, jquery-ui and fancybox
  2. Click on a link and fancybox opens with ajax content
  3. When the ajax loads jquery-ui tabs are triggered to make some tabs (the opened window contains tabs), also some links in the ajax content are binded to open in fancybox
  4. Click on a link in the ajax content and load another ajax content.
  5. After the content is loaded window.$ is present but window.$.fancybox is undefined.

What could remove fancybox from the jquery plugins?
I have also attached an image with the console explaining the steps.

enter image description here

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

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

发布评论

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

评论(1

南风几经秋 2025-01-05 21:47:55

经过半个小时的苦苦挣扎,没有找到问题所在,我写下了上面的帖子。写完之后我立刻就知道发生了什么事。我不会删除这个问题,因为它可能对其他人有帮助。

我的 ajax 请求之一还加载了一个新的 jquery 对象,该对象正在重置旧的对象,即插件。所有的人。

一旦不必要的请求被删除,一切就正常了。

After struggling for half an hour and not finding the problem I wrote the above post. Immediately after I wrote it I found out what was happening. I won't delete the question, as it may be of help to others.

One of my ajax requests was also loading a new jquery object which was resetting the old one, thus, the plugins. All of them.

Once the unnecessary request was removed everything works fine.

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