在 AJAX 加载的页面中使用 fancybox
我在这个组中搜索并四处搜索,但仍然没有找到答案 我还看到有些人有我的问题,但线程没有帮助,所以我在这里
问题很简单,为了帮助你,我打包了一个 .zip 与 您可以测试的文件
http://www.ivanhalen.com/fancyproblem.zip
- 我有一个主要包含一些链接的页面 (index.php)
- 单击它们会通过 AJAX 加载片段 (page.php)
- 在片段中有一个或多个链接,单击它们应该 打开一个 iframed fancybox (fb.php)
好吧,fancybox 无法工作,除了第一个打开的链接 然后我在 Firefox 中不断收到“t 未定义”错误,这表明 我无处可去 我真的尝试了我能想象到的一切,但仍然没有运气......
拜托,你能帮助我吗? 多谢
I searched in this group and googled around, but still no luck in answers
I see also that some have my problem, but the threads didn't help, so here I am
The question is easy, and to help you I've packed a .zip with the
files you can test
http://www.ivanhalen.com/fancyproblem.zip
- I have a main page with some linkes (index.php)
- Clicking on them loads a snippet througn AJAX (page.php)
- In the snippet there is one or more links, clicking on them should
open an iframed fancybox (fb.php)
Well, the fancybox just won't work, except for the first opened link
Then I keep getting a "t is not defined" error in Firefox, that points
me nowhere
I tried really everything I could imagine, but still no luck...
Please, can you help me?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要将脚本放入 ajax 响应内容中的
fancybox()
链接中。相反,您想要做的是将fancybox()
调用移至加载函数的complete()
回调中,如下所示:Don't put the script to
fancybox()
your links in content of the ajax response. Instead, what you want to do is move thefancybox()
call into thecomplete()
callback of the load function, like so: