Fancybox 2.0.4 fancybox 功能已从 jquery 插件中删除
首先是使用新版本fancybox时遇到的问题(http://fancyapps.com/fancybox/)。
我有一个使用 ajax 加载大部分页面的应用程序。场景如下:
- 我的主页加载了 jquery、jquery-ui 和 fancybox
- 单击链接,fancybox 将打开并显示 ajax 内容
- 当 ajax 加载 jquery-ui 选项卡时,会触发一些选项卡(打开的窗口包含选项卡), ajax内容中的一些链接也绑定在fancybox中打开
- 单击ajax内容中的链接并加载另一个ajax内容。
- 加载内容后,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:
- My main page loads with jquery, jquery-ui and fancybox
- Click on a link and fancybox opens with ajax content
- 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
- Click on a link in the ajax content and load another ajax content.
- 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过半个小时的苦苦挣扎,没有找到问题所在,我写下了上面的帖子。写完之后我立刻就知道发生了什么事。我不会删除这个问题,因为它可能对其他人有帮助。
我的 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.